|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
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 |
|
#2
|
|||
|
|||
|
<cfif #form.RegionTown# EQ 1>
............... <cfelse> ............... </cfif> |
|
#3
|
|||
|
|||
|
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. |
|
#4
|
|||
|
|||
|
thanks
Thanks for your help. a good forum
|
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > ColdFusion Development > simple if else question |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|