prevent user from going back or disable submit

Please support our JavaScript / DHTML / AJAX advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
Reply

Join Date: Jun 2009
Posts: 12
Reputation: itnagusak is an unknown quantity at this point 
Solved Threads: 0
itnagusak itnagusak is offline Offline
Newbie Poster

prevent user from going back or disable submit

 
0
  #1
Jun 30th, 2009
i have a form being filled. i don't want the user to be able to submit twice. how can i either prevent the user from going back or disable the submit button?

i am currently disabling the submit button but when the user clicks back(from the next page) it asks whether it should resend data. when the data is resent it loads the original version of the page(without submit disabled).

can someone help me with this? thanks.
Reply With Quote Quick reply to this message  
Join Date: Jun 2008
Posts: 185
Reputation: aashishn86 is an unknown quantity at this point 
Solved Threads: 9
aashishn86's Avatar
aashishn86 aashishn86 is offline Offline
Junior Poster

Re: prevent user from going back or disable submit

 
0
  #2
Jun 30th, 2009
are you using asp or any other server side scripting language ?
Last edited by aashishn86; Jun 30th, 2009 at 10:58 am.
rEaLITy iS aN iLLUSIOn cAUSED bY lACk oF aLCOHOL....
Reply With Quote Quick reply to this message  
Join Date: Jun 2009
Posts: 12
Reputation: itnagusak is an unknown quantity at this point 
Solved Threads: 0
itnagusak itnagusak is offline Offline
Newbie Poster

Re: prevent user from going back or disable submit

 
0
  #3
Jun 30th, 2009
i'm using javascript
Reply With Quote Quick reply to this message  
Join Date: Jun 2008
Posts: 185
Reputation: aashishn86 is an unknown quantity at this point 
Solved Threads: 9
aashishn86's Avatar
aashishn86 aashishn86 is offline Offline
Junior Poster

Re: prevent user from going back or disable submit

 
0
  #4
Jun 30th, 2009
Originally Posted by itnagusak View Post
i'm using javascript
javascript is for client side

anything for server side ?
rEaLITy iS aN iLLUSIOn cAUSED bY lACk oF aLCOHOL....
Reply With Quote Quick reply to this message  
Join Date: Jun 2009
Posts: 12
Reputation: itnagusak is an unknown quantity at this point 
Solved Threads: 0
itnagusak itnagusak is offline Offline
Newbie Poster

Re: prevent user from going back or disable submit

 
0
  #5
Jun 30th, 2009
no
Reply With Quote Quick reply to this message  
Join Date: Jun 2008
Posts: 185
Reputation: aashishn86 is an unknown quantity at this point 
Solved Threads: 9
aashishn86's Avatar
aashishn86 aashishn86 is offline Offline
Junior Poster

Re: prevent user from going back or disable submit

 
0
  #6
Jul 1st, 2009
can't think of anything
i'll post back if i can figure a way out...
rEaLITy iS aN iLLUSIOn cAUSED bY lACk oF aLCOHOL....
Reply With Quote Quick reply to this message  
Join Date: Jun 2008
Posts: 185
Reputation: aashishn86 is an unknown quantity at this point 
Solved Threads: 9
aashishn86's Avatar
aashishn86 aashishn86 is offline Offline
Junior Poster

Re: prevent user from going back or disable submit

 
0
  #7
Jul 1st, 2009
but if you aren't using any client side scripting language , how are you saving the data ?
rEaLITy iS aN iLLUSIOn cAUSED bY lACk oF aLCOHOL....
Reply With Quote Quick reply to this message  
Join Date: Jun 2009
Posts: 12
Reputation: itnagusak is an unknown quantity at this point 
Solved Threads: 0
itnagusak itnagusak is offline Offline
Newbie Poster

Re: prevent user from going back or disable submit

 
0
  #8
Jul 2nd, 2009
saving it to a file using php..is that a scripting language?
Reply With Quote Quick reply to this message  
Join Date: Jun 2008
Posts: 185
Reputation: aashishn86 is an unknown quantity at this point 
Solved Threads: 9
aashishn86's Avatar
aashishn86 aashishn86 is offline Offline
Junior Poster

Re: prevent user from going back or disable submit

 
0
  #9
Jul 2nd, 2009
Originally Posted by itnagusak View Post
saving it to a file using php..is that a scripting language?
yeah.....
rEaLITy iS aN iLLUSIOn cAUSED bY lACk oF aLCOHOL....
Reply With Quote Quick reply to this message  
Join Date: Jun 2009
Posts: 12
Reputation: itnagusak is an unknown quantity at this point 
Solved Threads: 0
itnagusak itnagusak is offline Offline
Newbie Poster

Re: prevent user from going back or disable submit

 
0
  #10
Jul 2nd, 2009
i tried using sessions..
i set a sessions variable to 1 if the form data was submitted.
i check if the the variable is one on the concerned page and if it is i call a function which disables the submit button. but this doesnt work either. any thoughts about this?

heres the code
JavaScript / DHTML / AJAX Syntax (Toggle Plain Text)
  1. <?php
  2. if($_SESSION['disable']==1){
  3. echo "<script type="text/javascript"> disablesbmt(); </script>";
  4. }
  5. ?>
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC