clear form data (IE problem)
-
i have one survey page (survey.aspx), on submit it inserts records in DB and redirect to (thanks.aspx). when again i used to execute same page its again insert data to DB and redirect to thanks.aspx page. but perticularly on IE(Internet explorer), second time & onwards its not inserting data and redirect to same page, i.e survey.aspx. i tried with page.forms[0].reset(); but its not working plz help. thanks in advance.
-
i have one survey page (survey.aspx), on submit it inserts records in DB and redirect to (thanks.aspx). when again i used to execute same page its again insert data to DB and redirect to thanks.aspx page. but perticularly on IE(Internet explorer), second time & onwards its not inserting data and redirect to same page, i.e survey.aspx. i tried with page.forms[0].reset(); but its not working plz help. thanks in advance.
1. are you using GET method? 2. use VS debugger and check the flow. Tell us whats causing it if you are unable to resolve it.
-
1. are you using GET method? 2. use VS debugger and check the flow. Tell us whats causing it if you are unable to resolve it.
i'm using like dis, function clear_form() { document.forms[0].reset(); } <form id="form1" runat="server" method="post" target="_self" onsubmit="this.clear_form();return true"> if you know any other way plz guide.
-
i'm using like dis, function clear_form() { document.forms[0].reset(); } <form id="form1" runat="server" method="post" target="_self" onsubmit="this.clear_form();return true"> if you know any other way plz guide.
punit belani wrote:
target="_self" onsubmit="this.clear_form();return true"
It says, clear the form on submit and reload the page! Where are you doing a DB update? Redirection to other page? further,
target
attributes generally work withaction
attribute. Why have you used target here? -
punit belani wrote:
target="_self" onsubmit="this.clear_form();return true"
It says, clear the form on submit and reload the page! Where are you doing a DB update? Redirection to other page? further,
target
attributes generally work withaction
attribute. Why have you used target here?actually im trying wid this, according to searching guide. the exact scenario is as i mentioned in question. so what can i do, if i want on submit first insert data and then reset the form and then redirect to thanks page?
-
actually im trying wid this, according to searching guide. the exact scenario is as i mentioned in question. so what can i do, if i want on submit first insert data and then reset the form and then redirect to thanks page?
punit belani wrote:
i want on submit first insert data and then reset the form and then redirect to thanks page
1. submit first. Use a Submit button 2. on button click event handler, insert the data in database 3. you don't need to clear the form! As you are already going to a Thank you page. Just redirect it the thanks page. 4. Whenever a new person does a survey, the page will load afresh and the controls will auto reset. Just in case (which you shouldnt!), you have a flow where you have to reset the controls manually for such kind of survey functionality - then do it on server side for that particular scenario. Clear the controls values of that panel.
-
punit belani wrote:
i want on submit first insert data and then reset the form and then redirect to thanks page
1. submit first. Use a Submit button 2. on button click event handler, insert the data in database 3. you don't need to clear the form! As you are already going to a Thank you page. Just redirect it the thanks page. 4. Whenever a new person does a survey, the page will load afresh and the controls will auto reset. Just in case (which you shouldnt!), you have a flow where you have to reset the controls manually for such kind of survey functionality - then do it on server side for that particular scenario. Clear the controls values of that panel.
ok fine. thanks again.