simple javascript form code
Posted
by
Steven Chaney
on Stack Overflow
See other posts from Stack Overflow
or by Steven Chaney
Published on 2012-11-13T04:08:10Z
Indexed on
2012/11/13
5:00 UTC
Read the original article
Hit count: 118
JavaScript
I have a simple question about running some JS in a form i am trying to make it so that if a user selects an option (entry_12) in a drop down list, that the next form fields are not required (entry_11 entry_13 entry_11) those are the IDs for the fields any thoughts?
im not sure where to start on this i have searched all over google and cannot find an instance of this. im trying to make it so if a user selects 'check' out of this list
<div class="ss-item ss-item-required ss-select"><div class="ss-form-entry"><label class="ss-q-title" for="entry_12">Card Type
<span class="ss-required-asterisk">*</span></label>
<label class="ss-q-help" for="entry_12"></label>
<select name="entry.12.single" id="entry_12"><option value="Check">Check</option>
<option value="Mastercard">Mastercard</option> <option value="Visa">Visa</option>
<option value="Amex">Amex</option> <option value="Discover">Discover</option></select></div></div></div>
that the next fields (cvc code, exp date, cc number) arent required as they are if they had chosen CC
© Stack Overflow or respective owner