Rich flash forms and validation functions

Ask a Question related to Coldfusion - Advanced Techniques, Design and Development.

  1. #1

    Default Rich flash forms and validation functions

    Hi. I used to use the following to validate my forms:
    Code:
     <!--- init form
    feilds ---> <cfparam name='form.FirstName' default=''> <cfparam
    name='form.Email' default=''>  <!--- init error structure ---> <cfset FormError
    = StructNew()> <cfset FormError.FirstName = false> <cfset FormError.Email =
    false> <cfset FormError.Error = false>  <cfif IsDefined('form.submit')>
    <!--- use my functions to assess the error state --->    <cfset
    FormError.Firstname  = NOT ValidFormField( 'Firstname', 'textfield' )>
    <cfset FormError.Email  = NOT ValidFormField( 'Email' , 'emailfield' )>
    <cfif FormError.Firstname OR FormError.Email>       <cfset FormError.Error =
    true>    </cfif>     <cfif NOT FormError.Error>           <!--- perform actions
    and go to sucess page --->       <cflocation url='somewherenice.cfm'>
    </cfif>  </cfif>   <!DOCTYPE HTML PUBLIC '-//W3C//DTD HTML 4.01
    Transitional//EN'>  <html> <head> 	<title>Form</title> </head>  <body>  <form
    action='#CGI.PATH_INFO#' methid='post' name='thisForm'>    <input
    name='Firstname' type='text' value='#form.Firstname#' class='form_input<cfif
    FormError.Firstname>_error</cfif>'>    <input name='Email' type='text'
    value='#form.Email#' class='form_input<cfif FormError.Email>_error</cfif>'>
    <input type='submit' value='submit'> </form>  </body> </html>
    Can I
    use the same functions, rather than Java-script, to validate and set the error
    states of rich forms? M@)

    game_on Guest

  2. Similar Questions and Discussions

    1. Flash Forms - Server Side Validation - Back Button
      I've tried the timeout attribute but that didn't help. What do I need to do so that form entries are not lost once a Flash form is submitted and...
    2. Flash Forms and Javascript Validation
      Ok, I am having a little trouble incorporating a javascript file that calls a function to validate form fields into my flash form. I am not sure...
    3. Flash Forms Query Data Validation
      I have a Flash Form that asks for an e-mail address. I would like to use client-side data validation within flash forms to check the database to...
    4. Validation bug in CF7 Flash forms
      When a cf7 flash form is submitted with client side validation and a field doesn't pass validation, an error message appears that will not go away....
    5. 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...
  3. #2

    Default Re: Rich flash forms and validation functions

    So it looks like you are just calling some server side validation when the
    form is submitted, and then changing the class attribute of the form fields
    if there has been an error, right?

    You can still use you server side validation, nothing has changed that would
    break that. But in the flash forms you can't use css classes, however, you
    can use css stylesheets inline with the style attribute.
    <cfif formError.Firstname>
    <cfset nameStyle = "...">
    <cfelse>
    <cfset nameStyle = "...">
    </cfif>

    <cfform>
    <cfinput type="text" style="#nameStyle#">
    </cfform>


    ---nimer


    "game_on" <webforumsuser@macromedia.com> wrote in message
    news:cvcdi7$8cu$1@forums.macromedia.com...
    > Hi. I used to use the following to validate my forms:
    Code:
     <!--- init
    > form
    > feilds ---> <cfparam name='form.FirstName' default=''> <cfparam
    > name='form.Email' default=''>  <!--- init error structure ---> <cfset
    > FormError
    > = StructNew()> <cfset FormError.FirstName = false> <cfset FormError.Email
    > =
    > false> <cfset FormError.Error = false>  <cfif IsDefined('form.submit')>
    > <!--- use my functions to assess the error state --->    <cfset
    > FormError.Firstname  = NOT ValidFormField( 'Firstname', 'textfield' )>
    > <cfset FormError.Email  = NOT ValidFormField( 'Email' , 'emailfield' )>
    > <cfif FormError.Firstname OR FormError.Email>       <cfset FormError.Error
    > =
    > true>    </cfif>     <cfif NOT FormError.Error>           <!--- perform
    > actions
    > and go to sucess page --->       <cflocation url='somewherenice.cfm'>
    > </cfif>  </cfif>   <!DOCTYPE HTML PUBLIC '-//W3C//DTD HTML 4.01
    > Transitional//EN'>  <html> <head> <title>Form</title> </head>  <body>
    > <form
    > action='#CGI.PATH_INFO#' methid='post' name='thisForm'>    <input
    > name='Firstname' type='text' value='#form.Firstname#'
    > class='form_input<cfif
    > FormError.Firstname>_error</cfif>'>    <input name='Email' type='text'
    > value='#form.Email#' class='form_input<cfif
    > FormError.Email>_error</cfif>'>
    > <input type='submit' value='submit'> </form>  </body> </html>
    > Can I
    > use the same functions, rather than Java-script, to validate and set the
    > error
    > states of rich forms? M@)
    >

    Mike Nimer 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