Re: Using Flexy::Elements for radio buttons in foreach loops

From: Date: Mon, 25 Oct 2004 00:50:26 +0000
Subject: Re: Using Flexy::Elements for radio buttons in foreach loops
References: 1  Groups: php.pear.general 
Request: Send a blank email to pear-general+get-15085@lists.php.net to get a copy of this message
On this template: {foreach:results,key,valueObj} : <ol type="A"> <li><label><input type="radio" value="1" type="radio" value="2" name="frmAnswer[{valueObj.quiz_id}]"
            id="frmAnswer_{valueObj.quiz_id}b"
name="frmAnswer[%s]" flexy:nameuses="valueObj.quiz_id" should work. - In the end, radio buttons are a royal pain in the ass, and a number of times I've just written a hack {radioButton(valueObj.quiz_id},2):h} Regards Alan
            />{valueObj.answer2:h}</label></li>
<li><label><input type="radio" value="3" name="frmAnswer[{valueObj.quiz_id}]"
            id="frmAnswer_{valueObj.quiz_id}c"
            />{valueObj.answer3:h}</label></li>
: </ol> </div> {end:} - The selected buttons don't get marked as checked. They do if the element names are fixed ie: <li><label><input type="radio" value="3" name="frmAnswer[0]"
            id="frmAnswer_0c" />{valueObj.answer3:h}</label></li>
Is there a workaround? I've googled and searched but not found any examples of this issue - if there is, point me in the right direction and I'll take it from there. Thanks Peter


« previous php.pear.general (#15085) next »