kee149
10-12-2006, 05:43 AM
i want to make a checkbox, and when we check in a checkbox it will show a dialog. after we choose some image file, we submit.
my code
<td><div align="center"><font size = 2 face="Arial, Helvetica, sans-serif">
<div id="Layer1">
<input type="file" name="idcard_file<? echo $forArrayValue; ?>"
style="position:absolute; z-index:1; VISIBILITY: hidden;">
</div>
<input type="checkbox" name="idcard<? echo $forArrayValue; ?>"
onClick="if (document.forms['frm_visa'].elements['idcard<? echo $forArrayValue; ?>'].checked==true)
document.forms['frm_visa'].elements['idcard_file<? echo $forArrayValue; ?>'].click();">
</font>
</div>
</td>
i wanna make a dynamic array for showing checkbox with PHP, anyway my problem is when i press submit button it's doesn't go on, i have to click twice .. ??? i don't understand so i try to change VISIBILITY: visible;. then i knew that the first press it make <input type="file" name="idcard_file<? echo $forArrayValue; ?>" style=" position:absolute; z-index:1; VISIBILITY: hidden;"> to be empty value and second press go to submit the form.
i dunno why ? I can't continue my program cause it can't get a file value.
pls help me
thk a lot
kee
my code
<td><div align="center"><font size = 2 face="Arial, Helvetica, sans-serif">
<div id="Layer1">
<input type="file" name="idcard_file<? echo $forArrayValue; ?>"
style="position:absolute; z-index:1; VISIBILITY: hidden;">
</div>
<input type="checkbox" name="idcard<? echo $forArrayValue; ?>"
onClick="if (document.forms['frm_visa'].elements['idcard<? echo $forArrayValue; ?>'].checked==true)
document.forms['frm_visa'].elements['idcard_file<? echo $forArrayValue; ?>'].click();">
</font>
</div>
</td>
i wanna make a dynamic array for showing checkbox with PHP, anyway my problem is when i press submit button it's doesn't go on, i have to click twice .. ??? i don't understand so i try to change VISIBILITY: visible;. then i knew that the first press it make <input type="file" name="idcard_file<? echo $forArrayValue; ?>" style=" position:absolute; z-index:1; VISIBILITY: hidden;"> to be empty value and second press go to submit the form.
i dunno why ? I can't continue my program cause it can't get a file value.
pls help me
thk a lot
kee