jquery - how to save data by disabled text box? -
in jsp page, 1 checkbox, 2 textbox , 1 submit button. checkbox used enabling , disabling text box. data saved when textbox enable not saved when textbox disable.
following code toggle.
function togglefields(status){ if (status==false){ $("#textbox1").removeattr("disabled"); $("#textbox2").removeattr("disabled"); } else { $("#textbox1").attr("disabled", "disabled"); $("#textbox2").attr("disabled", "disabled"); } }
please me in this.
you can use readonly
instead of disabled
.
$("#textbox1").attr("readonly", true);
your code be
function togglefields(status){ if (status==false){ $("#textbox1").attr("readonly", false); $("#textbox2").attr("readonly", false); } else { $("#textbox1").attr("readonly", true); $("#textbox2").attr("readonly", true); } }
Comments
Post a Comment