I have form which inserts new users into a DB.
The form has a "Terms and Conditions" checkbox which must be checked.
Is there a way of setting a new colour for the font if users don't check the box
ad then hit the Submit button ?
i.e. - hit the button, page reloads with the text next to the text box turned red ?
The text is a variable "termsMsg".
Code below:
Best wishes
Monty
Form
Code: Select all
//////////////// INSERT THE STUDENT INTO THE students_to_courses TABLE
$termsMsg ="I have read and agree with the terms and conditions";
if (isset ($_POST['terms_box'])){
$sql = mysql_query("INSERT INTO `students_to_courses` ( `id` , `student_fk` , `course_fk` , `course_completed` )
VALUES ('', '$id', '2', '0')")
or die (mysql_error());
$id = mysql_insert_id();
$msgToUser = "Top Stuff <span class=orangeText>$firstname</span>, you are signd up to <br><span class=Big_Blue_Times>Tune In To Programs !</span> <br>
Your download should start automatically and this course will now appear <br>
on the list of "Your Courses". You can click that link upload your coursework<br>
when you're ready. But enjopy the course first ! ";
include_once 'msgToUser.php';
exit();
}
html section:
Code: Select all
<td height="53"><form name="student_course_insert" method="post" action="signup_course2.php">
<div align="left"><br>
<?php print $termsMsg ?>
<input name="terms_box" type="checkbox" id="terms_box" value="checkbox">
<br>
Sign Me Up !
<input type="submit" name="SignUp" value="Submit">
<br>
</div>
</form></td>