exam questions

Exam 70-480 All Questions

View all questions & answers for the 70-480 exam

Exam 70-480 topic 2 question 26 discussion

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

You are developing a customer web form that includes the following HTML.
<input id="txtValue"/>
You need to change the HTML markup so that customers can enter only a valid three-letter country code.
Which HTML should you use?

  • A. <input id="txtValue" type="country"/>
  • B. <input id="txtValue" type="text" required="xxx"/>
  • C. <input id="txtVa!ue" type="text" pattern-" [A-Za-z] {3} "/>
  • D. <input id="txtValuen type="code" pattern"="country"/>
Show Suggested Answer Hide Answer
Suggested Answer: C 🗳️
HTML <input> pattern Attribute
The pattern attribute specifies a regular expression that the <input> element's value is checked against.

Example -
An HTML form with an input field that can contain only three letters (no numbers or special characters):
<form action="demo_form.asp">
Country code: <input type="text" name="country_code"
pattern="[A-Za-z]{3}" title="Three letter country code"/>
<input type="submit">
</form>
Reference: HTML <input> pattern Attribute
http://www.w3schools.com/tags/att_input_pattern.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
badgr
5 years, 6 months ago
and txtValue not txtVa!ue
upvoted 3 times
...
JMz123
5 years, 9 months ago
typo. s/b pattern= (not a hyphen.)
upvoted 2 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 ...