Sublime directory Surf the web anonymous Pagerank Monitor


php and javascript submit()

msthac01
Wed 25 June 2008, 09:47 pm GMT +0200
I have several pages where users can enter data as well as click on hyperlinks that use javascript to open a popup where they can enter some more data and then save and the popup will close and the original page will refresh itself automatically.  The issue is that if they enter data on the main page and then click the hyperlink without first saving the page, when they submit on the popup and the main page gets refreshed all of the data they entered on the main page is lost.  Is there any way to have the main page submit before the popup gets opened so that the users don't loose their data.  I've tried using the javascript document.formname.submit() but it just refreshes the page and doesn't submit the data.  I changed all of my submit buttons names from submit to update so as not to cause conflict but it still just refreshes the main page then opens the popup, and all data is lost.  Any ideas on how I could accomplish this task?  Thanks in advance.

Nikolas
Fri 27 June 2008, 10:49 am GMT +0200
Maybe you could solve this if you were sending the unsaved data  to the other pages too.

Use an onsubmit="" function to your forms in order to do that.

Archive for SMF v1.00 by N.P. Valid XHTML 1.0 Transitional