943,678 Members | Top Members by Rank

Ad:
  • ASP Discussion Thread
  • Unsolved
  • Views: 3463
  • ASP RSS
Oct 8th, 2008
0

asp form post, form validation, new window

Expand Post »
our website opens a NEW registration window [target="_blank"], register1.asp which submits form data to register2.asp "write to database" and "thank you for registering" page, by way of js form validation function - >>>i need to cause register2.asp to open without the ability to hit the BACK button [ie, no menu bar or address bar].<<< reason: people are registering online, then hitting BACK and hitting submit AGAIN, causing multiple database entries. <argh>

more simply: website opens new registration page, register1.asp. user submits info which gets form validated before sending to register2.asp. register2.asp need NO menu.

some code:
<form name="form1" method="POST" action="https://secureServerName/domain/register2.asp" onSubmit="return submitIt(this)">

this first passes form data to "submitIt()" function with "this" [this is the form data]. if everything passes TRUE, then it passes control to register2.asp. I need this register2.asp to NOT have a menubar.

I hope this does not sound too messy, and any ideas anyone?? thanks in advance for your time.
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
dcparham is offline Offline
7 posts
since Jun 2006
Oct 18th, 2008
0

Re: asp form post, form validation, new window

Ok...here is what you need to do.
html Syntax (Toggle Plain Text)
  1. <script>
  2. function submitIt(myForm) {
  3. var w = window.open('about:blank','Popup_Window','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbar=yes,resizable=yes,copyhistory=yes,width=200,height=200,left=10,top=10');
  4. myForm.target = 'Popup_Window';
  5. return true;
  6. }
  7. </script>
  8.  
  9. <form name="form1" method="POST" action="https://secureServerName/domain/register2.asp" onSubmit="return submitIt(this)">
  10. Form content
  11. </form>
Hopefully it should work for you.
Reputation Points: 9
Solved Threads: 1
Junior Poster in Training
msaqib is offline Offline
91 posts
since Sep 2004
Oct 19th, 2008
0

Re: asp form post, form validation, new window

thx, but i get error saying zero length field not allowed[database error] - doesn't seem to send the form data via the var w. wishing now there were some parameters when sending data via method="post", that would define the target window with no menu. my code with your suggestions - [form name is "form1"]:

var w = window.open('https://servername.ntsecure.net/domain/filename.asp','registerSendInfo','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbar=yes,resizable=yes,copyhistory=yes,width=200,height=200,left=10,top=10');
document.form1.target = 'registerSendInfo';
return true;
}//END submitIt

thx, though - i am tempted but not looking forward to creating code to check and reject if form data entered already exists in the database.
Reputation Points: 10
Solved Threads: 0
Newbie Poster
dcparham is offline Offline
7 posts
since Jun 2006

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in ASP Forum Timeline: ASP and Connectivity
Next Thread in ASP Forum Timeline: server problems? passing variable info...





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC