Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Javascript > javascript form action = send form details to ASP page

Reply
Thread Tools

javascript form action = send form details to ASP page

 
 
iam247@gmail.com
Guest
Posts: n/a
 
      08-07-2005
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

 
Reply With Quote
 
 
 
 
Randy Webb
Guest
Posts: n/a
 
      08-07-2005
http://www.velocityreviews.com/forums/(E-Mail 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;
}


--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
 
Reply With Quote
 
 
 
 
ASM
Guest
Posts: n/a
 
      08-07-2005
(E-Mail Removed) 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
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Hide Action details at Form section Sam Vel ASP .Net 2 03-13-2009 05:37 PM
Struts: 1 action, 1 Form, several views handled by 1 only action. Any idea for better design? John Java 0 06-26-2007 11:22 PM
javascript form validation - form action to another asp page iam247@gmail.com ASP General 7 08-20-2005 10:06 PM
Tranfering variable from a asp form page to a ACTION page Jack ASP General 9 12-23-2004 08:05 PM
Struts Static Action Form vs Dyanamic Action Form Joe Bloggs Java 1 08-03-2003 02:30 AM



Advertisments