If I use the below code, will it disable the textbox even if I am inserting a new record?
<input id="code" data-bind="value: Code" name="Code" type="text" placeholder="Your Code" class="form-control input-md" readonly>
If I use the below code, will it disable the textbox even if I am inserting a new record?
<input id="code" data-bind="value: Code" name="Code" type="text" placeholder="Your Code" class="form-control input-md" readonly>
You can do it in jQuery using .prop() method.
$('input').prop('readonly', true)
to disable the textbox or $('input').prop('readonly', false)
to re-enable the textbox
You can use JQuery to change attribute of a control
$("#code").attr("readonly", false);
jQuery <1.9
$('#inputId').attr('readonly', true);
jQuery 1.9+
$('#inputId').prop('readonly', true);