Ask a Question related to Coldfusion - Advanced Techniques, Design and Development.
-
game_on #1
Rich flash forms and validation functions
Hi. I used to use the following to validate my forms:
Can ICode:<!--- 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>
use the same functions, rather than Java-script, to validate and set the error
states of rich forms? M@)
game_on Guest
-
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... -
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... -
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... -
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.... -
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... -
Mike Nimer #2
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:> Can ICode:<!--- 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>
> use the same functions, rather than Java-script, to validate and set the
> error
> states of rich forms? M@)
>
Mike Nimer Guest



Reply With Quote

