14, October 2008

php and javascript submit() - webmaster forum

 
Webdigity webmaster forums
This forum shares its ad revenue with its members!
[ Home | Help | Search | Forum's Shop | Archive | Login | Register | Webmaster Directory ]
Webdigity Webmaster Forums  >  Web Development  >  PhP
Topic: php and javascript submit()
« previous next »
Pages: [1] Print

Author Topic: php and javascript submit()  (Read 297 times)
Sandwich Artist
*
Posts: 25
186 credits
Members referred : 0


« on: Jun 25, 2008, 10:47:10 PM »

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.
I am a metal monkey!
Administrator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 8126
41713 credits
Members referred : 3



« Reply #1 on: Jun 27, 2008, 11:49:59 AM »

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.

Trial and Error my two best teachers Cool
Join us @ facebook Visit through proxy

Last blog : Free Unlimited Bandwith and disk space to good to be true?
Trackback URI for this entry : http://www.webdigity.com/trackback.php?topic=7801
Tags : php javascript submit popup Bookmark this thread : Digg Del.icio.us Dzone more....

Topic sponsors:
Get a permanent link here for $1.99!


Pages: [1] Print 
Webdigity Webmaster Forums  >  Web Development  >  PhP
Topic: php and javascript submit()
« previous next »
Jump to:
User Area
Welcome, Guest. Please login or register.
Did you miss your activation email?
Oct 14, 2008, 01:24:49 PM





Login with username, password and session length

Donate to our community, and get a permanent link back to your site!

Donate to our community, and get a permanent link back to your site!


Forum Statistics
Total Posts: 36.975
Total Topics: 7.563
Total Members: 4.164
Tutorials : 56
Resources : 143
Designs : 220
Latest Member: blueberry62

28 Guests, 6 Users online :

19 users online today:



Readers

Web Design Gallery · Whois Lookup · Pagerank · Tag Browsing · Lo-fi version · Syndication · Webmaster forum history · Advertise
Developed by HumanWorks © 2005 - 2008 Webdigity webmaster community · sublime directory
Webdigity Webmaster Forums | Powered by SMF 1.0.12. © 2001-2005, Lewis Media. All Rights Reserved.