Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help with "if...then" statements in Coldfusion

Status
Not open for further replies.

sterek

Programmer
Oct 9, 2000
2
US
I'm a novice programmer trying to write a conditional statement coldfusion page for our site. There are 4 questions for the users to complete. Three of them are radio 'yes' or 'no' buttons. The 4th questions is a checkbox question with 3 options. Selecting different answers to the 4 questions produces different results. We do not have a database so I can't do a query. How can I program this so they can get the correct outcome?

Help! Thanks. [sig][/sig]
 
at the first place, do you HAVE TO use coldfusion, or can you use jscript ???
what do you mean with "produce different results" : do you want the user to be redirected to other pages ? or only a different message ?

if you want to use cfusion and not to redirect, you'll have to set 2 pages :
- on the first one is the form, with the form.action set to the url of the 2nd page (say <form ... action=&quot;my_second_page.cfm&quot; ...> ... </form>)
- on the second one you now have the selected values for each radiobutton/checkbox, and that's where you you can write your conditionnal statement
<cfif check_on eq &quot;on&quot;>...</cfif><cfif radiobt eq &quot;value&quot;> ...</cfif>

[sig][/sig]
 
Thanks. I don't have to use coldfusion, but I don't know how to program it in javascript.

The user will not be directed to a new page - they will only get a different message. There are a total of 9 message the user could get by answering the questions different ways. So, there can really be no CFPARAM set.

I have the form and the action pages set up. I have one huge conditional if...then statement set up and I'm getting a problem with the message that is displayed depending on how the user answers the questions.

Please feel free to check out my test page at: --- go ahead and test it and you will see what I mean. Thanks. [sig][/sig]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top