coldfusion question

They have: 8 posts

Joined: May 2000

To all CF people out there:

I am trying to do the following in cf: when a form is submitted, compare the value of two fields (namely password and verify password). The code:

code:

<cfif isdefined("form.Login_Password")>
 <cfset comparison = Compare(form.Login_Password, form.Verify_Password)>
  <cfswitch expression=#comparison#>
   <cfcase value="0">

   <!--SQL-->

   </cfcase>
   <cfdefaultcase>
   <!--SQL-->

   </cfdefaultcase>
  </cfswitch>
</cfif> 
[/code]

But I keep getting "Cold Fusion cannot determine how to process the tag <CFSWITCH>. The tag name may be misspelled". What am I doing wrong? 

TIA

ps. What are some good CF Forums? I don't see too many ColdFusion people here. Just RC from what I've read   

They have: 89 posts

Joined: Sep 1999

Hey hey temis.

OK first off. The BEST place for CF questions is the Allaire forums. There are literally hundreds of posts a day and questions are usually answered within a couple of hours.
http://forums.allaire.com/devconf/index.cfm

Now, onto your question. I am not sure cause I do not have it in front of me, but it looks like you are using a version of the book example?

Anyways, they always overcomplicate things. You don't need cfswitch of cfcase. Do this.

<cfif isdefined("form.pass1")>
<cfset comparison = Compare(form.pass1, form.pass2)>
<cfif comparison is 0>
Thank you, they are the same.
<cfelse>
Error, they don't match.
</cfif></cfif>

And of course take whatever appropriate actions, sql or otherwise dependedant upon the results.

RC

They have: 8 posts

Joined: May 2000

Thanks, RC.

I actually could have used CFSWITCH, but the problem was (duh!) that its a 4.0 tag, while the server is a good old 3!

I'll go check out Allaire forums too, some of my questions might already be answered

thx again!

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.