Adding validation to a Frontpage form (Full Version)

All Forums >> [Web Development] >> General Web Development



Message


barronbrian -> Adding validation to a Frontpage form (3/26/2001 20:55:00)

Hi All

I have a form designed in Frontpage and set to Email and store the results as a .csv file.

I need to add some more advanced validation than FrontPage is able to provide so I have developed my own validation routine in JavaScript. However if I try to add the code into Frontpages routine or modify the line that calls the validation to include my Function when I save the code Frontpage throws my code away!!

Is there any way to stop FrontPage from doing this or is there an other way I can include my own validation routines??

Thanks in advance

Brian Barron





Rian -> RE: Adding validation to a Frontpage form (3/26/2001 20:25:00)

My experience is that you can't mix any JavaScript validation with FP validation....You have to use only one or the other but not both.

Anybody else?

Rian

------------------
Webmaster
SR Web Creators
http://www.srwebcreators.com
_ _________________ _
"Press ENTER once to quit or twice to save changes..."
_ ________________ _





KevinB -> RE: Adding validation to a Frontpage form (3/26/2001 13:07:00)

I was able to incorporate my own JavaScript within FrontPage, the only trick is that you cannot have any of the other form fields set to use FrontPage validation. What I did was set all the fields to use FrontPage validation, saved the page and then I cut all the validation code out and placed it into Notepad. Then, I went back and took out all of the validation rules using FP in "normal" view. So now I had a form without any FP validation and I had the code that Front Page would normally use for validation saved in Notepad. Then I added the new form field validation code that I needed to the code that I had saved in Notepad (in this case it was code to validate an email address). Then, I copy and pasted the code I had in Notepad back into FrontPage using "HTML View" and named my new funtion:

function VerifyForm(Registration)

and then I added this to the <form> tag:

onsubmit="return VerifyForm(this)"


So basically this kind of tricks FrontPage into thinking you aren't using it's own validation when in fact you are using the same validation script it normally uses plus whatever you add to it.

Whatever you do, DO NOT go back into the form again and use FrontPage's validation because you it will bypass this newly created function.





barronbrian -> RE: Adding validation to a Frontpage form (3/27/2001 20:36:00)

Thanks all for your help.
After going back though Frontpage and removing all its validation I was able to add my own by inserting an 'onClick' into the submit button.

Why oh Why cant we just be able to add to what Frontpage has already created!!!

Cheers





Page: [1]

Valid CSS!




Forum Software © ASPPlayground.NET Advanced Edition 2.4.5 ANSI
0.0625