Eiolon Posted January 6, 2010 Share Posted January 6, 2010 I have a page with a series of check boxes. If one in particular is checked, it will disable the other ones. There are other fields on the page. When the fields are validated and an error occurs, the check box remains checked but it does not keep the other ones disabled. Here is what I am using for my code: <?php if ($_POST['no_registration_required'] == "1") { echo "<input name='no_registration_required' type='checkbox' id='no_registration_required' value='1' onclick='this.form.allow_online_registration.disabled = this.checked; this.form.ask_age.disabled = this.checked; this.form.ask_address.disabled = this.checked; this.form.ask_source.disabled = this.checked; this.form.fee_required.disabled = this.checked;' checked='checked' />"; } else { echo "<input name='no_registration_required' type='checkbox' id='no_registration_required' value='1' onclick='this.form.allow_online_registration.disabled = this.checked; this.form.ask_age.disabled = this.checked; this.form.ask_address.disabled = this.checked; this.form.ask_source.disabled = this.checked; this.form.fee_required.disabled = this.checked;' />"; } ?> Quote Link to comment Share on other sites More sharing options...
Eiolon Posted January 6, 2010 Author Share Posted January 6, 2010 Nevermind, found a solution Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.