Different labels for input file types in PHP/HTML -
i've simple problem can't seem fix :( .
i have following php variable:
$nrofattachments="2";
and in html code i've show number of file upload fields:
<?for($i=1;$i <= $nrofattachments; $i++) {?> <div class="form-group"> <label for="attachments" class="control-label">attachment(s)</label> <input name="attachment[]" type="file" id="attachments" size="30"/> </div> <?}?>
what want achieve different labels each input file type...
<? for($i=1;$i <=$nrofattachments; $i++) { echo '<div class="form-group"> <label for="attachments['.$i.']" class="control-label">attachment '.$i.'</label> <input name="attachment['.$i.']" type="file" id="attachments['.$i.']" size="30"/> </div>'; } ?>
Comments
Post a Comment