wysiwygGER01
Programmer
Hi,
I've got 2 forms and would like to have the same checkboxes checked on both forms.
My first form is this:
After hitting submit on the first form, I go to a 2nd form below. I can't think of a way to check the same checkboxes as on the first form? I was thinking of going through the first array and create a variable with the value "checked" for each hit - but I don't think that will work.
Any suggestions are much appreciated.
The reason I have 2 forms is because on the 2nd form I'll later at contact details which need to be filled out before submitting the form.
I've got 2 forms and would like to have the same checkboxes checked on both forms.
My first form is this:
Code:
<body>
<form method="post" action="form.php" name="brochures">
<input name="to_download[]" value="sbpdff1" type="checkbox"> Brochure 1<br>
<input name="to_download[]" value="sbpdff2" type="checkbox"> Brochure 2<br>
<input type="submit" value="Ok">
</form>
</body>
After hitting submit on the first form, I go to a 2nd form below. I can't think of a way to check the same checkboxes as on the first form? I was thinking of going through the first array and create a variable with the value "checked" for each hit - but I don't think that will work.
Any suggestions are much appreciated.
The reason I have 2 forms is because on the 2nd form I'll later at contact details which need to be filled out before submitting the form.
Code:
<?php
$box[]=($_REQUEST['to_download']);
$key = array_search('pbpdff1', $box);
If ($key=true)
{
$test = "CHECKED";
}
else{
$test = "";
}
?>
<!doctype html public "-//W3C//DTD HTML 4.0 //EN">
<html>
<body>
<h1>Information Request</h1>
<form action="form.php" method="post" name="information_request">
<strong>General Brochure</strong><br>
Brochure 1 <input type="checkbox" name="to_download[]" <?php echo $test; ?> value="pbpdff1"><br>
Brochure 2 <input type="checkbox" name="to_download[]" value="pbpdf2">
<input type="submit" name="send_request" value="Send request">
</form>
</body>