Reputation: 1664
I have a form that hides and shows option based on a drop down. If one option is selected there is a form that had required fields (). If the other option is selected I need to disable those required fields or the form won't submit.
Long and short. How do I remove the required for the input element via Javascript?
I was trying document.getItemById('firstName').?
Upvotes: 0
Views: 62
Reputation: 1664
document.getElementById('firstName').removeAttribute('required');
Upvotes: 1