
Originally Posted by
Paul O'B
Markup looks fine -- apart from the bug triggering comments (in particular comments between LI is just /FAIL/) the multiple 'let's open and close php on every line' are rubbish, but again I'm the guy who would like to see <?php and ?> removed from PHP altogether so... It's just sloppy coding.
Also since those elements are all alike, I'd put the options in a list and iterate the list to output them.
Something like:
Code:
$response=array(
'0' => 'Decide Later',
'1' => 'Accept',
'2' => 'Decline'
);
echo '
<li>
<a href="#">
User1<br />
<img src="/uploads/NoImage2_100x77.png" width="100" alt="Thumbnail of User1" />
</a>
<fieldset id="requestResponse">';
foreach ($response as $value => $label) {
echo '
<input type="radio" id="rad_',$value,'" name="requestResponse1" value="',$value,'",(
(isset($requestResponse1) && $requestResponse1==$value) ? ' checked="checked"' : ''
),' />
<label for="rad_',$value,'">',$label,'</label>';
}
echo '
</fieldset>
</li>';
Which knocks 400 bytes off the code, is still plenty clear, and is easier to add/remove buttons to.
Bookmarks