User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the ColdFusion section within the Web Development category of DaniWeb, a massive community of 426,414 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,341 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our ColdFusion advertiser: Programming Forums
Views: 790 | Replies: 0
Join Date: Jan 2008
Posts: 1
Reputation: cfintern is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
cfintern cfintern is offline Offline
Newbie Poster

Help cfset errorlist?

  #1  
Jan 20th, 2008
Hi, My name is Josh and as my username implies I am a Coldfusion Intern. I have learned everything about coldfusion from volumes 1 and 2. I have a question about cfset. I am making a error list using if statements like so:
<cfswitch expression="#form.a#">

   <cfcase value="submit">

         <cfif len(trim(FORM.username)) eq 0>

            <cfset VAR.signuperror1 = "Please fill in valid email address">

            <cfelseif FORM.username does not contain "@">

               <cfset VAR.signuperror1 ="Required email is invalid">

            <cfelseif FORM.username does not contain ".com">

               <cfset VAR.signuperror1 ="Required email is invalid example 'johndoe@hotmail.com'">

         </cfif>

         <cfif len(trim(FORM.fname)) eq 0>

            <cfset VAR.signuperror2 = "Please fill in full name">

         </cfif>

         <cfif len(trim(FORM.password)) eq 0>

            <cfset VAR.signuperror3 = "Please enter Password">

            <cfelseif isnumeric(FORM.password) eq 0>

               <cfset VAR.signuperror3 = "Password has to be Numeric">

         </cfif>
now in order for the user to get their data inserted in to my db the form has to pass this
<cfif len(trim(var.signuperror1)) eq 0 and len(trim(var.signuperror2)) eq 0 and ......>
is there a way to set this statement to a variable scope so all i have to do is <cfif var."name" eq 0>? thanks for the help.
AddThis Social Bookmark Button
Reply With Quote  

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb ColdFusion Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Other Threads in the ColdFusion Forum

All times are GMT -4. The time now is 1:50 pm.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC