nerdexam
Microsoft

70-515 · Question #54

You are developing a Web page. The user types a credit card number into an input control named cc and clicks a button named submit. The submit button sends the credit card number to the server. A…

The correct answer is D. On the form, add an onSubmit handler that calls CheckCreditCard and cancels the form. See the full explanation below for the reasoning.

Question

You are developing a Web page. The user types a credit card number into an input control named cc and clicks a button named submit. The submit button sends the credit card number to the server. A JavaScript library includes a CheckCreditCard function that returns a value of true if the credit card appears to be valid, based on its checksum. You need to ensure that the form cannot be used to submit invalid credit card numbers to the server. What should you do?

Options

  • AConfigure the input control to run on the server.
  • BOn the input control, add an onChange handler that calls CheckCreditCard and cancels the
  • CConfigure the input control and the submit button to run on the server.
  • DOn the form, add an onSubmit handler that calls CheckCreditCard and cancels the form

How the community answered

(17 responses)
  • B
    12% (2)
  • C
    6% (1)
  • D
    82% (14)

Community Discussion

No community discussion yet for this question.

Full 70-515 Practice