ColdFusion Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsProgramming Languages - MoreColdFusion Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old February 5th, 2004, 09:50 AM
elise_driver elise_driver is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2004
Location: Norwich
Posts: 53 elise_driver User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 5 h 27 m 10 sec
Reputation Power: 10
simple if else question

I am new to coldfusion. I am having problems with the syntax. This should be easy.


With this code:

<td><select name="RegionTown">
<option value="0">Search by town or region</option>

<option value="1">Search by region</option>

<option value="2">Search by town</option>

</select></td>

i want to do this if else statement:

<cfif name="RegionTown" option value="1">

... Do something here

<cifelse>

... Do something different here

</cif>


Hope you can help.

Cheers

Peter

Reply With Quote
  #2  
Old February 5th, 2004, 11:56 AM
bwedekin bwedekin is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2003
Location: Dubai, UAE
Posts: 449 bwedekin User rank is Corporal (100 - 500 Reputation Level)bwedekin User rank is Corporal (100 - 500 Reputation Level)bwedekin User rank is Corporal (100 - 500 Reputation Level)bwedekin User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 3 Days 22 h 51 m 39 sec
Reputation Power: 13
<cfif #form.RegionTown# EQ 1>

...............

<cfelse>

...............

</cfif>

Reply With Quote
  #3  
Old February 5th, 2004, 12:44 PM
kiteless kiteless is offline
Moderator
Dev Shed God (5000 - 5499 posts)
 
Join Date: Jun 2002
Location: Raleigh, NC
Posts: 5,091 kiteless User rank is General (90000 - 100000 Reputation Level)kiteless User rank is General (90000 - 100000 Reputation Level)kiteless User rank is General (90000 - 100000 Reputation Level)kiteless User rank is General (90000 - 100000 Reputation Level)kiteless User rank is General (90000 - 100000 Reputation Level)kiteless User rank is General (90000 - 100000 Reputation Level)kiteless User rank is General (90000 - 100000 Reputation Level)kiteless User rank is General (90000 - 100000 Reputation Level)kiteless User rank is General (90000 - 100000 Reputation Level)kiteless User rank is General (90000 - 100000 Reputation Level)kiteless User rank is General (90000 - 100000 Reputation Level)kiteless User rank is General (90000 - 100000 Reputation Level)kiteless User rank is General (90000 - 100000 Reputation Level)kiteless User rank is General (90000 - 100000 Reputation Level)kiteless User rank is General (90000 - 100000 Reputation Level)kiteless User rank is General (90000 - 100000 Reputation Level) 
Time spent in forums: 2 Weeks 5 Days 2 h 53 m 27 sec
Reputation Power: 966
You don't need the pound signs:

<cfif form.regionTown eq 1>
...


However, I suspect that what this person is trying to do must be done with Javascript. It looks like they are trying to make CF respond to a change in a form field within the same page, which CF can't do (nor any other server-side application server). If you post this form to the server, the next page can respond based on the selection that was submitted. But without a page refresh, you have no choice but to write Javascript event handlers to do this.

Reply With Quote
  #4  
Old February 6th, 2004, 02:21 AM
elise_driver elise_driver is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2004
Location: Norwich
Posts: 53 elise_driver User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 5 h 27 m 10 sec
Reputation Power: 10
thanks

Thanks for your help. a good forum

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreColdFusion Development > simple if else question

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap