How can I refresh or reload a form using JQuery?
I am filling my form using session values. Using Jquery Post I unset session, but then the values are already filled in the form.
I am trying to reset all form values after un setting the session with the following code:
$('#form')[0].reset();
Yet it is not working afte开发者_JS百科r the $post ajax call.
Do you have this?
<form id="form">.....</form>
If you do, it should work. If you don't have an "id" for your form tag, you should use
$("form")[0].reset();
Note that browser settings also dictate this. Make sure that you have disabled any auto-form filling settings or any plugins.
If you are working in STRUTS-2.0 then you've to do like this for refreshing form reset:
<s:submit name="operation" value="Create Account" onclick="location.reload();" />
精彩评论