473,788 Members | 2,837 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

javascript form validaion won't post to asp page

Hi

I have an asp page without any javascript. It posts the content of a
form to another page, which reads the form fields using Request.Form.

This is the form header:

<form name=form method=post action=RegDetai ls.asp>

I have tried to modify the form by adding javascript for password
validation. The script came from:

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

The form header from this javascript is:

<form name=myForm onSubmit="retur n validatePwd()">

This header validates my passwords ok but obviously is missing,
method=post & action=RegDetai ls.asp

When have combined the to form headers to give:

<form name=myform method=post onSubmit="retur n validatePwd()"
action=RegDetai ls.asp>

This header still validates the password but does not Post to
RegDetails.asp

On pressing submit the form fields are sent via the url as a
querystring, back to the same form/page which opens blank.

I would appreciate help in using the javascript to validate my form but
still Post the form values to RegDetails.asp

Thanks ColinK

Aug 8 '05 #1
3 3262

I see nothing wrong with the js, post the url of the page to see what's
not working.
Danny
--
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/
Aug 8 '05 #2
Hi Danny
Thanks for your interest. Hopefully the following will more accurately
clarify the problem.

If I copy all of the script from:
<form name=myform method=post onSubmit="retur n validatePwd()"
action=RegDetai ls.asp>

Into a new page, the validation works fine. If the 2 passwords match
the final result is:
1. The "nice Job" alert pops up
2. A blank form reloads with the original url + the querystring of
Password 1& 2
eg
http://localhost/gc7/www/pass.asp?pa...ssword2=123456

If I remove the complete line for the last alert
alert('Nice job.');

Result 1 above obviously does not work but result 2 does.

The Problem

If I change the form header from the original to any of the 2
alternatives - shown at bottom (from my own original non validating
page) The form does not validate the passwords but post to
RegDetails.asp - same as my own original.

I want to be able to validate and post - but I can't do both

Thanks ColinK
ORIGINAL
<form name=myForm onSubmit="retur n validatePwd()">
ALTERNATIVE1
<form name="myform" method="post" onSubmit="retur n validatePwd()"
action="RegDeta ils.asp">
ALTERNATIVE2
<form name=myform method=post onSubmit="retur n validatePwd()"
action=RegDetai ls.asp>

Note I have 2 alternatives as the javascript did not seem to like the
"" in some parts of my original page.

Aug 8 '05 #3
ASM
ia****@gmail.co m wrote:
If I copy all of the script from:
You have to copy-paste the whole JS script
You have to copy-past the 2 elements nammed 'password' and 'pasword2'
in the html code of your form

Your form must to be what you write here :
<form name=myform method=post onSubmit="retur n validatePwd()"
action=RegDetai ls.asp>

Into a new page, the validation works fine. If the 2 passwords match
the final result is:
1. The "nice Job" alert pops up
Yes
and ...
the form is submitted

that's to say : the page 'pass.asp' is called
2. A blank form reloads with the original url + the querystring of
Password 1& 2
eg
http://localhost/gc7/www/pass.asp?pa...ssword2=123456


exactly : it is what that has to do

-> your page 'pass.asp' has to treate one (or better : both) of the
two passwords given in end of url
It is to *you* to build your *asp program* in this page

--
Stephane Moriaux et son [moins] vieux Mac
Aug 11 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
9656
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9498
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10175
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10112
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9969
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6750
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5536
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4070
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3675
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.