CodeCharge Studio
search Register Login  

Visual Web Reporting

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> Archive -> CodeCharge.Discussion

 Form Validation with Javascript

Print topic Send  topic

Author Message
Anthony Trotter
Posted: 05/22/2001, 6:50 AM

I want to add client side JavaScript for certain types of form
validation. I can include a .js file in the page header of my form.
What I can't figure out is how to add the following event to my form:

onSubmit="return validateForm()"

Is this possible or should I stick with server-side validation? My JS
contains validation for no whitespace, alpha-only and alphanumeric.

Thanks in advance.

Alexey Alexapolsky
Posted: 05/23/2001, 1:37 AM

With codecharge you can do both server and client side validation.
As to client side your can do it by adding the following code
to "Form properties"/Header&Footer/Footer

<script language="javascript">
document.yourFormName.onsubmit="return validateForm()";
</script>

--
Regards,
Alexey
CodeCharge Support



Anthony Trotter <support@worldnetcity.com> wrote in message
news:9edqqd$33d$1@mail.tankhill.com...
> I want to add client side JavaScript for certain types of form
> validation. I can include a .js file in the page header of my form.
> What I can't figure out is how to add the following event to my form:
>
> onSubmit="return validateForm()"
>
> Is this possible or should I stick with server-side validation? My JS
> contains validation for no whitespace, alpha-only and alphanumeric.
>
> Thanks in advance.
>
>

Thierry B.
Posted: 05/29/2001, 8:43 PM

Dans l'article <9efst2$p08$1@mail.tankhill.com>,alexa@codecharge.com
nous disais...
> With codecharge you can do both server and client side validation.
> As to client side your can do it by adding the following code
> to "Form properties"/Header&Footer/Footer
>
> <script language="javascript">
> document.yourFormName.onsubmit="return validateForm()";
> </script>

Maybe I missed something but with ie5.5 this does not work. I wrote my
checkDate call in "Form properties/Header&Footer/Footer" and my checkDate
function in the page property/header. CC put the first javascript just
under the </form> tag and the second javascript just under the </head>
tag.

I have not put my hands in javascript for a long time but the only way I
suceeded to make this thing working was to write the OnSubmit event at
the end of the " <form " line :

onsubmit="return CheckDate(document.MyFormName.MyText.value)"

I tried to write you code
<script language="javascript">
> document.MyFormName.onsubmit="return CheckDate(document.MyFormName.MyText.value)";
> </script>
anywhere and the function is not called.

--

Thierry B.
thierry.bo@NOSPAMnetcourrier.com
---------------------------------------------------------------------
Email/Mél :REMOVE/ENLEVER "NOSPAM" from Email to answer/de l'Email pour
me répondre
---------------------------------------------------------------------
Anthony Trotter
Posted: 05/31/2001, 5:38 AM

I have a a function "function validateForm()" that I include as a *.js
(for neatness) in the HEAD of my forms.

My <form> tag reads:
-------------------------------------------
<form method="Post" name=myForm action="form.asp" onSubmit="return
validateForm()">
-------------------------------------------
I'm not a JS guru, but check to make sure that your JS references your
form name in the function.

Hope that helps.


"Thierry B." <thierry.bo@NOSPAMnetcourrier.com> wrote in message
news:MPG.157e4566bda62ba0989682@news.codecharge.com...
> Dans l'article <9efst2$p08$1@mail.tankhill.com>,
alexa@codecharge.com
> nous disais...
> > With codecharge you can do both server and client side validation.
> > As to client side your can do it by adding the following code
> > to "Form properties"/Header&Footer/Footer
> >
> > <script language="javascript">
> > document.yourFormName.onsubmit="return validateForm()";
> > </script>
>
> Maybe I missed something but with ie5.5 this does not work. I wrote
my
> checkDate call in "Form properties/Header&Footer/Footer" and my
checkDate
> function in the page property/header. CC put the first javascript
just
> under the </form> tag and the second javascript just under the
</head>
> tag.
>
> I have not put my hands in javascript for a long time but the only
way I
> suceeded to make this thing working was to write the OnSubmit event
at
> the end of the " <form " line :
>
> onsubmit="return CheckDate(document.MyFormName.MyText.value)"
>
> I tried to write you code
> <script language="javascript">
> > document.MyFormName.onsubmit="return
CheckDate(document.MyFormName.MyText.value)";
> > </script>
> anywhere and the function is not called.
>
> --
>
> Thierry B.
>thierry.bo@NOSPAMnetcourrier.com
> --------------------------------------------------------------------
-
> Email/Mél :REMOVE/ENLEVER "NOSPAM" from Email to answer/de l'Email
pour
> me répondre
> --------------------------------------------------------------------
-


   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

Internet Database

Visually create Web enabled database applications in minutes.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.