exam questions

Exam 70-480 All Questions

View all questions & answers for the 70-480 exam

Exam 70-480 topic 2 question 43 discussion

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

You are developing a customer web form that includes following HTML.
<input id= "textAccountType"/>
You need to develop the form so that customers can enter only a valid account type consisting of two English alphabet characters.
Which code segment should you use?

  • A. Option A
  • B. Option B
  • C. Option C
  • D. Option D
Show Suggested Answer Hide Answer
Suggested Answer: B 🗳️
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 two letters (no numbers or special characters):
<form action="demo_form.asp">
Country code: <input type="text" name="country_code"
pattern="[A-Za-z]{2}" 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
NellyM
4 years, 8 months ago
When do we use .val and .text?
upvoted 1 times
alexcode
4 years, 8 months ago
We use .val
upvoted 1 times
...
[Removed]
4 years, 5 months ago
You should use .val for input elements and .text for things like label, p, h1, and so on
upvoted 1 times
...
...
pdbeta
4 years, 10 months ago
B and D look the same answer??
upvoted 2 times
ziemcd
4 years, 8 months ago
B uses .val , D uses .text
upvoted 2 times
...
...
JMz123
5 years, 8 months ago
Best site ever. Answer corresponds to a different way of doing it.
upvoted 4 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 ...