apowers20
07-07-2005, 09:47 PM
Hi,
A little problem I am facing. What is happening is that a user selects a radio button and then a JavaScript displays the appropriate fieldset with more options for the user to pick.
Upon submitting the form, there is a PHP validation script that is run and if there is an error the page reloads with the error message, but my fieldset that was displayed on the prior page does not show unless I click the radio button again (The radio button is marked already on this page).
My question is:
How do I get my PHP validation to recognize the JavaScript and leave the users selection checked and shown if there is an error? Any help would be much appreciated. Thanks.
The code that I need to say something:
<?php
if ($errors) {
print "<p class='stdfnt_red'> There are errors in the form.<br> Please correct the fields marked in red</p>";
if ($_POST['style'] == 'calsecrx' || 'calsecrx2' || 'calsecrx3' || 'calsecrx3b' || 'calsecrx4' || 'calsecrx4c') {
Display the fieldset with an error;
}
if ($_POST['style'] == 'calsecrx4b') {
Display the fieldset with an error;
}
}
?>
A little problem I am facing. What is happening is that a user selects a radio button and then a JavaScript displays the appropriate fieldset with more options for the user to pick.
Upon submitting the form, there is a PHP validation script that is run and if there is an error the page reloads with the error message, but my fieldset that was displayed on the prior page does not show unless I click the radio button again (The radio button is marked already on this page).
My question is:
How do I get my PHP validation to recognize the JavaScript and leave the users selection checked and shown if there is an error? Any help would be much appreciated. Thanks.
The code that I need to say something:
<?php
if ($errors) {
print "<p class='stdfnt_red'> There are errors in the form.<br> Please correct the fields marked in red</p>";
if ($_POST['style'] == 'calsecrx' || 'calsecrx2' || 'calsecrx3' || 'calsecrx3b' || 'calsecrx4' || 'calsecrx4c') {
Display the fieldset with an error;
}
if ($_POST['style'] == 'calsecrx4b') {
Display the fieldset with an error;
}
}
?>