kickstart Posted March 5, 2009 Share Posted March 5, 2009 Hi Not sure if this is the right place for this. I have an application that has various form fields with drop down list. Users select items from the various lists and press add, which puts some form fields at the bottom of the screen using Javascript, with the actual input fields held in hidden fields inside a new div, along with a bit of visable text. Once they have finished adding fields then the form is submitted, generating a graph. Now the browser I mainly use is Opera and one advantage of this is that the back button doesn't reload the form normally. It used to be the case that pressing back mean all the dynamically added form fields were still there, but on the latest versions they are not. I really don't want to modifiy it to try and pass back all the selected options and recreate the screen. Any ideas on getting Opera to keep the contents of the dynamically created divs when the back button is pressed (note that the normal form fields keep their value). All the best Keith PS - if you are wondering the site enables you to generate a graph of thrust at the rear wheel against speed, in various gears on motorcycles, and allow you to overlay graphs with the same bike but with different gearing - hence being able to add the same bike several times with different gearing and the dynamically generated input fields. Quote Link to comment Share on other sites More sharing options...
Daniel0 Posted March 6, 2009 Share Posted March 6, 2009 You could add an event handler to onload and write a function in Javascript that resets the form. I would be careful with that though. People might have entered something wrong and want to go back to correct it. It might be annoying for them if they have to start over. So perhaps it would be better to have a reset button that triggers the aforementioned resetting function. Quote Link to comment Share on other sites More sharing options...
kickstart Posted March 6, 2009 Author Share Posted March 6, 2009 Hi Trouble is that the data that I would need to reset the form is in the hidden dynamically created fields that the browser has wiped out when returning to the page. Although that did give me a thought. As the number of sets of data is limited (currently to 10, as otherwise the resulting graphs get too difficult to read) I could put the hidden fields up in advance and just populate them with Javascript. Just would rather not have to have predefined numbers of lines in the design of the page. All the best Keith Quote Link to comment Share on other sites More sharing options...
Daniel0 Posted March 6, 2009 Share Posted March 6, 2009 Oh sorry, I think I read your first message wrong. I read it as though the browser wasn't resetting, but you wanted it to. I suppose you then just could redisplay the form below the graph to the user. In that way you eliminate the problem by not having to go back in the first place. Quote Link to comment Share on other sites More sharing options...
kickstart Posted March 6, 2009 Author Share Posted March 6, 2009 Hi Trouble is the possibly rather large amount of data. I could use javascript / ajax to put the image at the bottom of the page I suppose (only issue is the length of the query string, but should be fine for that), and just reset it to get the new graph. The page is:- http://www.bikegraph.co.uk/TorqueGraphs.php It works fine in older versions of Opera, but not in the current versions which leave the normal form fields set (which I like and is one of the reasons I have used Opera for years) but wipes out the dynamically created text and form fields. I suppose the advantage of putting the graph on the bottom of the screen is that it wouldn't wipe out the fields in IE either. All the best Keith Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.