Code: Select all
<form enctype="multipart/form-data" action="" method="post">
<strong>Something:</strong> <input type="text" name="f1"><br />
<strong>Something else:</strong> <input type="text" name="f2"><br />
<strong>Checkbox data:</strong> <checkbox_data><input type="hidden" value="<checkbox_data>" name="check_data" />
<div id="checkbox_div">Value1: <input type="checkbox" value="Value1" name="c1"> Value2: <input type="checkbox" value="Value2" name="c2"> Value3: <input type="checkbox" value="Value3" name="c3"> Value4: <input type="checkbox" value="Value4" name="c4"> Value5: <input type="checkbox" value="Value5" name="c5"></div>
<center><input value="Add" name="submit" type="submit"></center>
</form>1) If you select for example name="c1" and name="c3", <checkbox_data> should be 'Value1, Value3'.
2) - If name="f1" is empty, it should add style="background-color: red;" for the input. It should also add disabled="disabled" to the submit field.
- If name="check_data" is empty, it should add style="background-color: red;" for the div checkbox_div. It should also add disabled="disabled" to the submit field.
Sorry if the explanation is bad :p