Forum

Number Of Page View:100,000+/Months
LOGIN |New User

Reply

How to submit a form or part of a form without refresh the page?
 If you created a form I told you have to set "form" element and "onSubmit" attribute into JavaScript function that returns false.
Example:
<form onSubmit="doAJAXSubmit();return false;" ><input type="hidden" name="phpMyAdmin" value="f43d4e0b88acea2d2a393515f6bf38f2" /><input type="hidden" name="phpMyAdmin" value="70ac9566533a2665b6597346aab7f985" />
<input type="text" id="tf1" />
<input type="submit" id="submit1" value="Update"/>
</>
 If you want to submit data than you perform that task when we associated a function with form button.
Example:
<form onSubmit="doAJAXSubmit();return false;" ><input type="hidden" name="phpMyAdmin" value="f43d4e0b88acea2d2a393515f6bf38f2" /><input type="hidden" name="phpMyAdmin" value="70ac9566533a2665b6597346aab7f985" />
<input type="text" id="tf1" />
<input type="button" id="button1" onClick="doAJAXSubmit()" value="Update"/>
</>
 "onSubmit" attribute is still set.When client hits the enter key in the text field the form will be submitted.To handle this we have solution write below.
 When you updating the page than you have make sure that AJAX update of the form data was successful before updating the data in the page. Otherwise, The data may not properly update and the Client may not know. I like to provide an informative message when doing a partial update and upon a successful AJAX interaction after that I will update this page.