I’ve a form with this radio button:
<ul>
<li><input type="checkbox" name="repeat_period_week_day" value="1" /> Sunday</li>
<li><input type="checkbox" name="repeat_period_week_day" value="2" /> Monday</li>
<li><input type="checkbox" name="repeat_period_week_day" value="3" /> Tuesday</li>
<li><input type="checkbox" name="repeat_period_week_day" value="4" /> Wednesday</li>
<li><input type="checkbox" name="repeat_period_week_day" value="5" /> Thursday</li>
<li><input type="checkbox" name="repeat_period_week_day" value="6" /> Friday</li>
<li><input type="checkbox" name="repeat_period_week_day" value="7" /> Saturday</li>
</ul>
On form submission, I would like check which of these radios were ticked by user. Is it possible to verify without looping? I mean is there in CFML a function similar to the in_array() found PHP or something close ?
By default, the values of all the checkboxes that were checked will be submitted as a comma-delimited list. So if Sunday and Saturday were checked and the form submitted, you’d end up with:
If you wanted to find out if the Saturday box was checked, you could use the ListFind() function like so: