Coldfusion: how get value of the radio button to do the loop? -
for example:
how many item want select? 1 2 3 4
if 3 selected then
loop 1 3
do something
end loop
i want process in same page. can let me know need do? tried cfselect , radio buttons no luck. thank you.
i think you're on thinking problem. form return value of selected radio button.
html:
<form method="post" action=""> <p>how many want?!? choose now!</p> <input type="radio" name="varname" value="1" onclick="this.form.submit();">1 <input type="radio" name="varname" value="2" onclick="this.form.submit();">2 <input type="radio" name="varname" value="3" onclick="this.form.submit();">3 <input type="submit"> </form>
coldfusion:
<cfif isdefined("form.varname") , form.varname gt 0> <cfloop index="i" from="1" to="#form.varname#" step="1"> <!--- stuff ---> </cfloop> </cfif>
Comments
Post a Comment