javascript - Question related to input field -
javascript - Question related to <select> input field -
i have 3 <select> input fields: <select name=first>,<select name=second>and<select name=three>. 2nd , 3rd fields disabled. if user changes value of first field, 2nd field should enabled , on. there illustration related task? thanks
in easiest way, can bind event handler elements change event , adjust disabled property:
var form = document.getelementbyid('formid'); form.first.onchange = function() { form.second.disabled = false; }; form.second.onchange = function() { form.three.disabled = false; }; demo
i suggest disable fields via javascript, otherwise, if users have javascript disabled, cannot utilize form.
javascript html
Comments
Post a Comment