Deal of The Day! Hurry Up, Grab the Special Discount - Save 25% - Ends In 00:00:00 Coupon code: SAVE25
Welcome to Pass4Success

- Free Preparation Discussions

CIW Exam 1D0-735 Topic 8 Question 61 Discussion

Actual exam question for CIW's 1D0-735 exam
Question #: 61
Topic #: 8
[All 1D0-735 Questions]

Consider the following code:

The code displays a pop-up alert message if the username is less than 6 characters and submits the form. What change should be made to prevent the form from submitted if the username is less than 6 characters?

Show Suggested Answer Hide Answer
Suggested Answer: A

Contribute your Thoughts:

Lorrie
3 days ago
But wouldn't adding 'return false;' prevent the form from submitting if the username is less than 6 characters?
upvoted 0 times
...
Timothy
5 days ago
I disagree, I believe the answer is C) submit false; should be added after the alert call on line 7
upvoted 0 times
...
Lavonna
6 days ago
Hmm, interesting. I was thinking that we could just change the function call on line 13 to validateForm(), but Option B seems like the more elegant solution. Gotta love those JavaScript tricks!
upvoted 0 times
...
Juliann
7 days ago
Ah, I see what the problem is! The form is submitting even when the username is less than 6 characters. Clearly, we need to add a return false; after the alert call to prevent the form from submitting. Option B is the way to go here.
upvoted 0 times
...
Lorrie
9 days ago
I think the answer is B) Return false; should be added after the alert call on line 7
upvoted 0 times
...

Save Cancel