![]() |
after form submit and use back button..form have values...need to remove - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: after form submit and use back button..form have values...need to remove (/showthread.php?tid=18946) Pages:
1
2
|
after form submit and use back button..form have values...need to remove - El Forum - 05-23-2009 [eluser]dine[/eluser] Hi I need very urgent help from ur side When i do search with some data. it redirect me to result-data page. but when I use browser back button on result page.... I get search form with same values prefilled i am sorry for my english. but only what all i want to remove those fields values when I back to that page thanks a lot after form submit and use back button..form have values...need to remove - El Forum - 05-23-2009 [eluser]Dam1an[/eluser] This is expected behavious, why do you NEED to clear the values when you go back? If you reloa that page (force refresh) it clears the values just like it should after form submit and use back button..form have values...need to remove - El Forum - 05-23-2009 [eluser]TheFuzzy0ne[/eluser] If you want the results to be cleared, just redirect back to that page again once the form has been submitted successfully. Using the back button will pull up the cached results, which you have little/no control over. after form submit and use back button..form have values...need to remove - El Forum - 05-23-2009 [eluser]Dam1an[/eluser] Actually, you could send a no cache header... someone had a similar problem a few days back and that solved it after form submit and use back button..form have values...need to remove - El Forum - 05-23-2009 [eluser]Vi.[/eluser] As I remember, I used like this solution. Add this code to submit button's action. Data will be post before all input reset. Code: onsubmit="document.form_name.reset();" after form submit and use back button..form have values...need to remove - El Forum - 05-23-2009 [eluser]dine[/eluser] [quote author="inSerenity" date="1243096766"]As I remember, I used like this solution. Add this code to submit button's action. Data will be post before all input reset. Code: onsubmit="document.form_name.reset();" Don't know why but it's not working. I means I lost all data after form submit and use back button..form have values...need to remove - El Forum - 05-23-2009 [eluser]Dam1an[/eluser] Would reseting the form on submit not clear all the data before its sent in the POST array? after form submit and use back button..form have values...need to remove - El Forum - 05-23-2009 [eluser]dine[/eluser] [quote author="Dam1an" date="1243102223"]Would reseting the form on submit not clear all the data before its sent in the POST array?[/quote] Thanks for reply What all I am doing and getting is : If I set this "Onsubmit" event on submit button... it remains data in cache..I means data display in form when use back button If I set this event on form it reset the values but there is also on values in POST.. I know it is Obvious and I am doing wrong after form submit and use back button..form have values...need to remove - El Forum - 05-23-2009 [eluser]Dam1an[/eluser] Have you tried sending the no cache header, as explained in this post after form submit and use back button..form have values...need to remove - El Forum - 05-23-2009 [eluser]Vi.[/eluser] Code: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" Here is my code. I tried this code and It is working only with IE. Modern browsers use cache for fast Go back. You can check this page to no-cache header. This is easy way to do. |