MattDLEA Posted February 24, 2014 Posted February 24, 2014 I need to be able to check for a tick box then show or hide a field and depending on that result clear a value from a field. I have some code that i can PM if someone can help
Marci Posted February 24, 2014 Posted February 24, 2014 PM me your code fella... and workflow. Check for tick box & it's status on pageload? Or watch tick box for an event? Or both? 1
mikecampbell Posted March 5, 2014 Posted March 5, 2014 I'm presuming you want to register listeners on both the checkbox (to show the hidden field) and the hidden field itself (to clear the value from some other field), so something like this: $("#checkbox_selector").on('change', function() { if (this.checked) $("#hidden_field_selector").show(); else $("#hidden_field_selector").hide(); }); $("#hidden_field_selector").on('change', function() { if ($(this).val() == "whatever") $("#some_other_field").val(""); }); Perhaps.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now