exam questions

Exam 70-480 All Questions

View all questions & answers for the 70-480 exam

Exam 70-480 topic 1 question 9 discussion

Actual exam question from Microsoft's 70-480
Question #: 9
Topic #: 1
[All 70-480 Questions]

You are developing a customer web form that includes the following HTML.
<input id = "txtValue" />
A customer must enter a value in the text box prior to submitting the form.
You need to add validation to the text box control.
Which HTML should you use?

  • A. <input id="txtValue" type="text" required="required"/>
  • B. <input id="txtValue" type="text" pattern="[A-Za-z]{3}" />
  • C. <input id="txtValue" type="required" />
  • D. <input id="txtValue" type="required" autocomplete="on" />
Show Suggested Answer Hide Answer
Suggested Answer: A 🗳️
Definition and Usage -
The required attribute is a boolean attribute.
When present, it specifies that an input field must be filled out before submitting the form.

Example -
An HTML form with a required input field:
<form action="demo_form.asp">
Username: <input type="text" name="usrname" required />
<input type="submit" />
</form>
Username: <input type="text" name="usrname" required />
Reference: HTML <input> required Attribute
http://www.w3schools.com/tags/att_input_required.asp

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
NellyM
4 years, 7 months ago
Input type can not be set to required. C is wrong
upvoted 2 times
...
assadk
4 years, 8 months ago
The answer should be C.
upvoted 1 times
assadk
4 years, 8 months ago
A mixture of A and C rather: `<input id="txtValue" type="text" required />`
upvoted 1 times
...
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...