Dynamically generating input field [closed]
开发者_开发百科
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question<? $fileUpload=3 ; for($i=0;i<$fileUpload;$i++) { ?>
<input type="file" name="upload_file" value="" id=" " />
<? } ?>
I want to actually generate three file upload field based on the loop, but this code is not working.
Actual requirement
On the click of the browse button, if the file is selected... the next field of form should appear... automatically and so on.
<?php $fileUpload=3 ; for($i=0;$i<$fileUpload;$i++) { ?>
<input type="file" name="upload_file" value="" id=" " />
<?php } ?>
You needed to change "i" to "$i" in your break condition.
Also don't get into the habit of short PHP opening tags: Link
精彩评论