• +91 9723535972
  • info@interviewmaterial.com

Ajax Interview Questions and Answers

Question - How do I submit a form or a part of a form without a page refresh?

Answer - When creating a form make sure that the "form" element "onSubmit" attribute is set to a JavaScript function that returns false. You can also submit data by associating a function with a form button in a similar way. Note that the form "onSubmit" attribute is still set. If the user hits the enter key in the text field the form will be submitted so you still need to handle that case. When updating the page it is recommend you wait to make sure that the AJAX update of the form data was successful before updating the data in the page. Otherwise, the data may not properly update and the user may not know. I like to provide an informative message when doing a partial update and upon a successful AJAX interaction I will then update the page.

Comment(S)

Show all Coment

Leave a Comment




NCERT Solutions

 

Share your email for latest updates

Name:
Email:

Our partners