By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,575 Members | 1,402 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,575 IT Pros & Developers. It's quick & easy.

javascript form action = send form details to ASP page

P: n/a
Hi

In my prototype asp page (with no javascript and no password
validation, I have a registration form with the following action:

<form name="form" method="post" action="RegDetails.asp">

This works fine, the form details are collected by RegDetails.asp

I am attempting to include javascript server side validation for the
pasword, which obviously requires password and password2 fields (to be
verified). I have used the script available at:

http://javascript.internet.com/forms/val-pass.html

It works fine in a new blank page with the form action:

<form name=myForm onSubmit="return validatePwd()">

The final stage in this javascript demo form displays an alert box:

else {
alert('Nice job.');
return true;
When I change the first line of my original form to:

<form name=myForm onSubmit="return validatePwd()">

how do I get my original action of - action="RegDetails.asp" instead
of this alert box?

Thanks ColinK

Aug 7 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
ia****@gmail.com said the following on 8/6/2005 8:10 PM:
Hi

In my prototype asp page (with no javascript and no password
validation, I have a registration form with the following action:

<form name="form" method="post" action="RegDetails.asp">

This works fine, the form details are collected by RegDetails.asp

I am attempting to include javascript server side validation for the
pasword, which obviously requires password and password2 fields (to be
verified). I have used the script available at:

http://javascript.internet.com/forms/val-pass.html

It works fine in a new blank page with the form action:

<form name=myForm onSubmit="return validatePwd()">

The final stage in this javascript demo form displays an alert box:

else {
alert('Nice job.');
return true;
When I change the first line of my original form to:

<form name=myForm onSubmit="return validatePwd()">

how do I get my original action of - action="RegDetails.asp" instead
of this alert box?


Add the action attribute back to your form, and change the else to look
like this:

else{
return true;
}
--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
Aug 7 '05 #2

P: n/a
ASM
ia****@gmail.com wrote:
The final stage in this javascript demo form displays an alert box:

else {
alert('Nice job.');
return true;
here you cant notice 'return true'
that means : OK, authorized submitting
When I change the first line of my original form to:

<form name=myForm onSubmit="return validatePwd()">
that's wrong
how do I get my original action of - action="RegDetails.asp" instead
of this alert box?


the alert won't stop the call to your asp (if all is correct)

and you have to write :

<form name="form" action="RegDetails.asp"
onSubmit="return validatePwd()" method="post">
--
Stephane Moriaux et son [moins] vieux Mac
Aug 7 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.