Java script reset problem
-
I have one asp.net page (Page1) with llots of controls. After submitting this page, I have another page (Page2) on which there is one link which redirects me again to the same page from which I came from but with prefilled values. On the original page (Page1), there is one link "Clear Fields". Onclick of this link I want to clear all the controls. document.forms[0].reset() --- Not working in this case. Before submitting the form, if I fill up the values and click on "Clear Fields" link, I am able to reset all the controls but once I submit the form and came back to the same page, the above javascript code is not working. Can anyone help me!!
-
I have one asp.net page (Page1) with llots of controls. After submitting this page, I have another page (Page2) on which there is one link which redirects me again to the same page from which I came from but with prefilled values. On the original page (Page1), there is one link "Clear Fields". Onclick of this link I want to clear all the controls. document.forms[0].reset() --- Not working in this case. Before submitting the form, if I fill up the values and click on "Clear Fields" link, I am able to reset all the controls but once I submit the form and came back to the same page, the above javascript code is not working. Can anyone help me!!
-
I have one asp.net page (Page1) with llots of controls. After submitting this page, I have another page (Page2) on which there is one link which redirects me again to the same page from which I came from but with prefilled values. On the original page (Page1), there is one link "Clear Fields". Onclick of this link I want to clear all the controls. document.forms[0].reset() --- Not working in this case. Before submitting the form, if I fill up the values and click on "Clear Fields" link, I am able to reset all the controls but once I submit the form and came back to the same page, the above javascript code is not working. Can anyone help me!!
First of all it seems an extremely poor design to one a page that simply redirects back to the page you came from, and is most likely causing you more difficulties. Using viewstate, or some other form of persistence, the controls can retain there values between postbacks. You should also be using a cross-browser JavaScript library such as JQuery.
I know the language. I've read a book. - _Madmatt
-
First of all it seems an extremely poor design to one a page that simply redirects back to the page you came from, and is most likely causing you more difficulties. Using viewstate, or some other form of persistence, the controls can retain there values between postbacks. You should also be using a cross-browser JavaScript library such as JQuery.
I know the language. I've read a book. - _Madmatt
Here is my problem... On first page, i have some fields for user input. Based on user input on first page, will display the results on second page. On second page, i have modify button, which takes me to first page. So clicking on reset button on first page doesn't clear off all the fields if i coming from second page. Before submitting the first page, the values are resetting.
-
Here is my problem... On first page, i have some fields for user input. Based on user input on first page, will display the results on second page. On second page, i have modify button, which takes me to first page. So clicking on reset button on first page doesn't clear off all the fields if i coming from second page. Before submitting the first page, the values are resetting.
This functionality can, and should, be accomplished on the same page. Enabling or disabling the controls to put them in edit mode or non-edit mode is the typical implementation and what would be expected by users.
I know the language. I've read a book. - _Madmatt