Quiz Space

Modern Application Development I · Quiz 2 · 1 Dec 2024 · September 2024 term

Question 6: Consider the following HTML document “form.html” and the …

Question 6

+3 marksOne or more correct options

Consider the following HTML document “form.html” and the flask route given in “app.py”. Assume all the required methods are imported, Which of the following statements is/are correct.

Filename: form.html

html
<!DOCTYPE html>
<html>
<head>
<style>
input:valid {border: 2px solid red;}
</style>
</head>
<body>
<form action="/submit_form" method="post">
<label for="e-mail">Please enter your email address</label>
<input id="e-mail" name="e-mail" required/>
<button>Submit</button>
</form>
</body>
</html>

Filename: app.py

python
@app.route('/submit_form', methods = ['GET', 'POST'])
def form_on_submit():
if request.method == 'POST':
email = request.form.get('e-mail')
if "@" in email:
return "Form is validated"
return render_template('form.html')

Select all that apply.

  1. A

    The above HTML document has frontend validation incorporated, using HTML5 form validation.

  2. B

    The above HTML document has only backend validation incorporated.

  3. C

    The above HTML document has both frontend and backend validation incorporated.

  4. D

    If the e-mail input field is left blank, the border colour of the input field will be red.

Show answer

Correct answers

  • A

    The above HTML document has frontend validation incorporated, using HTML5 form validation.

  • C

    The above HTML document has both frontend and backend validation incorporated.

Question 6 of 16 in the IIT Madras BS Modern Application Development I (MAD 1) Quiz 2 paper sat on 1 Dec 2024, in the September 2024 term (IIT M DIPLOMA AN EXAM QDD2 01 Dec 2024). It carries 3 marks.

More questions from this paper

  1. Q1You have a DRAM module with bus width of 64 bits, clock speed of 800 MHz, and operating in DDR (double-data-rate or two…
  2. Q2Figure question
  3. Q3Consider the following python code. Consider that the above code is running locally on “http://127.0.0.1:5000”. What wi…
  4. Q4Consider the following flask application. app.py Which of the following statements is/are true if the application is ru…
  5. Q5Consider the following flask application. app.py Which of the following statements is/are true if the application is ru…
  6. Q7Consider the following flask code. If the flask server is running locally on “http://127.0.0.1:5000/”. Which of the fol…
  7. Q8Consider the flask code below. Assume that the above flask application is running on http://127.0.0.1:5000. Which of th…
  8. Q9Consider a character set Q, which consists of only those characters used in the sentence, "the five boxing wizards jump…
  9. Q10We are trying to create two models ‘Student’ and ‘Assignment’ and they are related by one-to- many relationship(i.e., o…
  10. Q11What will be returned on the terminal 2 for the command:
  11. Q12What will be returned on the terminal 2 for the command:
  12. Q13Which of the following statements are correct?
  13. Q14Identify the correct order of tasks that take place when a client makes a request on the URL: https://example.com/home.…
  14. Q15Consider the following statements and select the correct option.\ Statement 1: Redundancy is used to improve performanc…
  15. Q16The term “stateless” in the context of a server means that _