Flash Form Validation

Ask a Question related to Coldfusion Flash Integration, Design and Development.

  1. #1

    Default Flash Form Validation

    Hi,

    I have a flash form as below.

    <cfform action="#CGI.SCRIPT_NAME#?event=users.passwordchan geaction"
    method="post" name="passwordchange" height="300" width="400" skin="haloblue"
    format="flash" preloader="yes">

    <cfinput type="text" name="currentpassword" size="12"
    message="Please enter current password!" label="Current Password"
    required="yes" />

    <cfinput type="text" name="newpassword" size="12" message="Please
    enter new password!" label="New Password" required="yes" />

    <cfinput type="text" name="newpassword2" size="12" message="Please
    enter new password again!" label="New Password Again" required="yes" />

    <cfinput type="submit" name="changepassword" value="Change My
    Password" label="Submit" validate="submitonce" />
    </cfform>

    I want to validate whether newpassword and newpassword2 fields are identical
    or not on client side. Are there any method such as bind etc. to do this?

    TIA!

    Best regards,

    O?uz Demirkap?



    CFTR Guest

  2. Similar Questions and Discussions

    1. 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...
    2. 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...
    3. 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...
    4. 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"...
    5. 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...
  3. #2

    Default Re: Flash Form Validation

    You can do this with the <cfform onSubmit> attribute.

    try this:
    -----------------------------
    <cfform action="#CGI.SCRIPT_NAME#?event=users.passwordchan geaction"
    method="post" name="passwordchange" height="300" width="400" skin="haloblue"
    format="flash" preloader="yes" onSubmit="if( newpassword.text !=
    newpassword2.text ){ alert('passwords don\'t match'); return false; }">

    <cfinput type="text" name="currentpassword" size="12"
    message="Please enter current password!" label="Current Password"
    required="yes" />

    <cfinput type="text" name="newpassword" size="12"
    message="Please
    enter new password!" label="New Password" required="yes" />

    <cfinput type="text" name="newpassword2" size="12"
    message="Please
    enter new password again!" label="New Password Again" required="yes" />

    <cfinput type="submit" name="changepassword" value="Change My
    Password" label="Submit" validate="submitonce" />
    </cfform>

    -----------------------------

    hth,
    ---nimer


    "CFTR" <oguz@cftr.net> wrote in message
    news:cvj2ma$46m$1@forums.macromedia.com...
    > Hi,
    >
    > I have a flash form as below.
    >
    > <cfform action="#CGI.SCRIPT_NAME#?event=users.passwordchan geaction"
    > method="post" name="passwordchange" height="300" width="400"
    > skin="haloblue"
    > format="flash" preloader="yes">
    >
    > <cfinput type="text" name="currentpassword" size="12"
    > message="Please enter current password!" label="Current Password"
    > required="yes" />
    >
    > <cfinput type="text" name="newpassword" size="12"
    > message="Please
    > enter new password!" label="New Password" required="yes" />
    >
    > <cfinput type="text" name="newpassword2" size="12"
    > message="Please
    > enter new password again!" label="New Password Again" required="yes" />
    >
    > <cfinput type="submit" name="changepassword" value="Change My
    > Password" label="Submit" validate="submitonce" />
    > </cfform>
    >
    > I want to validate whether newpassword and newpassword2 fields are
    > identical
    > or not on client side. Are there any method such as bind etc. to do this?
    >
    > TIA!
    >
    > Best regards,
    >
    > O?uz Demirkap?
    >
    >
    >

    Mike Nimer Guest

  4. #3

    Default flash form validation

    having a hard time changing a text field to propercase onchange in a flash
    form..below is my cfinput and my javascript, any ideas?

    <script language = "JavaScript">
    //custom function to convert text to proper-noun case (initial caps).
    function pcase(str) {
    strlen = str.length
    jj = str.substring(0,1).toUpperCase()
    jj = jj + str.substring(1,strlen).toLowerCase()
    for (i = 2; i <= strlen; i++) {
    if (jj.charAt(i)==" ") {
    lefthalf = jj.substring(0,i+1)
    righthalf = jj.substring(i+1,strlen)
    righthalf =
    righthalf.substring(0,1).toUpperCase()+righthalf.s ubstring(1,strlen)
    jj=lefthalf+righthalf
    }
    }
    return jj
    }
    </script>

    <cfinput type="text" name="FirstName" message="Please enter in a first name."
    height="17" width="150" label="First Name:" validateat="onSubmit"
    required="yes" onchange="getURL('javascript:this.value=pcase(this .value)')">

    michin11 Guest

  5. #4

    Default Flash Form Validation

    having a hard time changing a text field to propercase onchange in a flash
    form..below is my cfinput and my javascript, any ideas?

    <script language = "JavaScript">
    //custom function to convert text to proper-noun case (initial caps).
    function pcase(str) {
    strlen = str.length
    jj = str.substring(0,1).toUpperCase()
    jj = jj + str.substring(1,strlen).toLowerCase()
    for (i = 2; i <= strlen; i++) {
    if (jj.charAt(i)==" ") {
    lefthalf = jj.substring(0,i+1)
    righthalf = jj.substring(i+1,strlen)
    righthalf =
    righthalf.substring(0,1).toUpperCase()+righthalf.s ubstring(1,strlen)
    jj=lefthalf+righthalf
    }
    }
    return jj
    }
    </script>

    <cfinput type="text" name="FirstName" message="Please enter in a first name."
    height="17" width="150" label="First Name:" validateat="onSubmit"
    required="yes" onchange="getURL('javascript:this.value=pcase(this .value)')">

    michin11 Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139