javascript form action = send form details to ASP page

I

iam247

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
 
R

Randy Webb

(e-mail address removed) 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;
}
 
A

ASM

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">
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,767
Messages
2,569,572
Members
45,045
Latest member
DRCM

Latest Threads

Top