speedyrudolf
Programmer
Hi. I'm having a pretty hard time figuring how to do something... In a nutshell, I have a form, when submitted it calls a php page that emails me the form, if it can't email it, it stores the form field values in a txt file, then calls up another php page, which is actually the form with the fields already populated (the field values are read from the file and assigned to the respective fields). What I'm having trouble with is some checkboxes and radios: they already have values assigned to them, so I don't know how to check them if they were previously checked.
Anyway...maybe part of the code will clear things up a bit:
Well...like I said, this is just a small part of the code...the entire file has about 80KB...
Anyway...If the checkbox was previously checked, in the txt file the respective line would say ON, if it was unchecked it would say OFF. And for the radios, the txt file would contain the value of the one that was checked.
So...How do I go and do that? Any help will be very much appreciated...
Anyway...maybe part of the code will clear things up a bit:
Code:
<?php
$fis_txt=fgets($eroare, 102400);
$text_txt=fgets($eroare, 102400);
$nav_sel=fgets($eroare, 102400);
for($i=0; $i<22; $i++)
{$navs.$i=fgets($eroare, 102400);}
?>
<html>
<input type="radio" name="Text" value="Fisier" onClick="Val_text();Cont_pag2();">Check the one that was previously checked
<input type="radio" name="Text" value="Text" onClick="Val_text();Cont_pag2();">Check the one that was previously checked
<input type="file" name="Fis_txt" size="100" value="<?php echo $fis_txt; ?>" onChange="Cont_pag2()">
<textarea name="Text_txt" cols="80" rows="10" value="<?php echo $text_txt; ?>" onKeyUp="Cont_pag2()">
<input type="checkbox" id="Navs0" name="Navs0" value="1" onClick="Cont_pag5_3()">Check it if it was previously checked, if not leave it unchecked
<input type="checkbox" id="Navs1" name="Navs1" value="1" onClick="Cont_pag5_3()">Check it if it was previously checked, if not leave it unchecked
<input type="checkbox" id="Navs2" name="Navs2" value="2" onClick="Cont_pag5_3()">Check it if it was previously checked, if not leave it unchecked
And so on until Navs21
</html>
Anyway...If the checkbox was previously checked, in the txt file the respective line would say ON, if it was unchecked it would say OFF. And for the radios, the txt file would contain the value of the one that was checked.
So...How do I go and do that? Any help will be very much appreciated...