Ask a Question related to Coldfusion - Advanced Techniques, Design and Development.
-
Mike Nimer #1
Re: Validation with a flash form
You need to do this with inline actionscript, instead of javascript.
try this:
<cfform format="flash">
<cfinput type="Text" name="jsPass1" label="pass1">
<cfinput type="Text" name="jsPass2" label="pass2">
<cfinput type="Button" name="foo" value="submit"
onClick="if( jsPass1.length == 0 ){ alert('Password cannot be blank.'); }
else if( jsPass1.length < 4 ){ alert('Password must be at least 4
characters.'); } else if (jsPass1.text != jsPass2.text){ alert('Password
and Confirmation must match'); } else { submitForm(); }">
</cfform>
hth,
---nimer
"ccsimmons" <webforumsuser@macromedia.com> wrote in message
news:cusutu$si7$1@forums.macromedia.com...>I really like the look of the flash forms for a project I am working on,
>but I
> need to be able to do all the validations I was doing with regular old
> HTML
> forms and JavaScript. Previously the following javascript was called
> onSubmit
> of the form. It checks to see if 1 field is blank, compares 2 fields
> within
> the form to be sure they are the same, and it also checks to see if 1 of
> the
> fields is at least 4 characters. Any help with this would be extremely
> appreciated.
>
> <script language="JavaScript">
> function doCheck(){
> var jsPass1 = MainForm.txtPassword.value
> var jsPass2 = MainForm.txtPassword2.value
>
> if (jsPass1 == ""){
> alert("Password cannot be blank.")
> return false;
> }
>
> if (jsPass1.length < 4){
> alert("Password must be at least 4 characters.")
> return false;
> }
>
> if (jsPass1 == jsPass2){
> return true;
> }else{
> alert("Password & Confirmation must match.")
> return false;
> }
>
> }
> </script>
>
Mike Nimer Guest
-
Flash form with cfinput validation not working
when using a cfform with format flash and using a cfinput in that form the validate field does not work. but when using the same validation with a... -
CFFORM Validation trumping Custom Form Validation
Is there any way for custom form validation to work in concert with the cfform validation? I have a custom script that compares the values of two... -
Flash Form Validation
Hi, I have a flash form as below. <cfform action="#CGI.SCRIPT_NAME#?event=users.passwordchangeaction" method="post" name="passwordchange"... -
flash form validation functions
had to play around with it, turns out you can't put that complex of actionscript in the bind attribute. But if you use a button, or anything with a... -
form validation in flash mx
i've created a simple form in flash that is hooked to a scrpit that handles the information but i wish for flash to validate some basic info before...



Reply With Quote

