Hello everyone As I have no experience with javascript I would like some help of how to enable or disable some expecific fields.
In that Script below and that's exactly what I need only when putting it in the code it disables fields that do not need to be disabled. I would like to know how this code can be changed to just some fields that contain example .. an id = x
<script type='text/javascript'>//<![CDATA[
$(window).load(function(){
$(document).ready(function() {
$("#enable").click(function (){
// habilita o campo
$("input").prop("disabled", false);
$("select").prop("disabled", false);
});
$("#disable").click(function (){
// desabilita o campo
$("input").prop("disabled", true);
$("select").prop("disabled", true);
});
});
});//]]>
</script>
<button href="#" id="enable" >Habilita Campos</button>
<button href="#" id="disable" >Desabilita Campos</button>
<input type="text" id="campo" name="campo1" disabled/> <br/>
<input type="text" id="campo" name="campo2" disabled/> <br/>
<input type="text" name="campo3" disabled/> <!--exemplo Não fazer nada -->