radio button and only can continue if they choose something

not sure how to do this more simple but I want to use the radio function:

Which to choose?
<<radio $ingredient "cheese" "flour" "tomato" "garlic">>

but they can't advance to the next page if they don't choose... is there a way to do that... or must i use the "if" function:

<<if $ingredient is "cheese" or "flour" or "tomato" or "garlic">>
<<display 'Happy3'>>
<<else>>
<b>Please go back to previous page to select the ingredient.</b>
[[BACK TO PREVIOUS|Happy]]
<<endif>>

but still this doesn't work .... it only displays the next page no matter what i choose...

Comments

  • Try this:

    <<if $ingredient is "cheese" or $ingredient is "flour" or $ingredient is "tomato" or $ingredient is "garlic">>
    <<display 'Happy3'>>
    <<else>>
    <<display 'Happy'>>
    <<endif>>

    I think the problem is you are testing if$ingredient is "cheese" or if "flour" or..., and As far as Javaascript is concerned, "flour" is a value so is considered true.
  • That's an important point - see the "invalid usage" section of this page: http://twinery.org/wiki/expression#invalid_usage
Sign In or Register to comment.