This question concerns a small php template for a questionnaire that has javascripted radio buttons (images) instead of html radio buttons.
1) is there a way to use an incrementing php variable inside the anchor tags for the radio images?
2) if that is possible, how might one loop through an array of questionnaire items, to print each item (and its html) along with one increment of the radio code block?
Below are the anchor tags representing a 5-option radio object. Can one plunk this in a php variable as shown, and create a script that can EVAL the $radio block and print one with an increment of $k that corresponds to the questionnaire item enumeration?
<pre>
$radio="
<a href=\"javascript:setRadio(<? $k ?> ,1)\"><img src=\"/ipqpics/off_1.gif\" width=\"25\" height=\"24\" border=\"0\" name=\"radio_<? $k ?> _1\"></a>
<a href=\"javascript:setRadio(<? $k ?> ,2)\"><img src=\"/ipqpics/off_2.gif\" width=\"24\" height=\"24\" border=\"0\" name=\"radio_<? $k ?> _2\"></a>
<a href=\"javascript:setRadio(<? $k ?> ,3)\"><img src=\"/ipqpics/off_3.gif\" width=\"24\" height=\"24\" border=\"0\" name=\"radio_<? $k ?> _3\"></a>
<a href=\"javascript:setRadio(<? $k ?> ,4)\"><img src=\"/ipqpics/off_4.gif\" width=\"24\" height=\"24\" border=\"0\" name=\"radio_<? $k ?> _4\"></a>
<a href=\"javascript:setRadio(<? $k ?> ,5)\"><img src=\"/ipqpics/off_5.gif\" width=\"25\" height=\"24\" border=\"0\" name=\"radio_<? $k ?> _5\"></a>
" ;
</pre>