I am programming one form and I would like to have this functionality:
If you click over United States as your country, some inputs get unlocked (before they are disabled). I have created this code in jquery:
$('option#usa').click(function(){
$('.inputText').attr('disabled', false);
})
habilita : function(){
$(".inputText").removeAttr("disabled");
}
deshabilita: function(){
$(".inputText").attr("disabled","disabled"); }
And in the HTML document I have this:
<span class="texto azul">Country</span><select class="caja" name="country">
<option value="">Country...</option>
<option value="Afganistan">Afghanistan</option>
<option value="Albania">Albania</option>
<option value="United States of America" onclick="habilita()">USA</option>
</select>
<span id="usa" class="texto azul">HCP Designation</span><select name="hcp" disabled="disabled" class="caja inputText">
<option value="des">Designation...</option>
<option value="md">MD</option>
</select><br /><br />
<span id="texto" class="texto azul">If other, please specify</span>
<textarea class="caja inputText" name="texto" disabled="disabled"></textarea><br /><br />
<span class="texto azul">State of Licensure</span><input class="caja inputText" name="state" type="text" disabled="disabled"/><br /><br />
<span class="texto azul">License number</span><input class="caja inputText" name="license" type="text" disabled="disabled"/><br /><br />
</form>
The problem is that I never achieve that the fields appear unlocked.