javascript - JQuery change input field -
i working on webpage contains input field needs changed programmatically using stored string php variable. this jquery code , doing need. $(function(){ $('.start').click(function(e) { var currentpage = "<?php echo $name;?>"; $('input').val(currentpage); $('.textfield').prop("disabled", true ); $('.textfield').css('cursor','not-allowed'); }); }); when click start button name inserted input element, when click submit button, error message popup "field required". question is, why changed input value doesn't work. if add or remove letter submit button working , there no field message popup. thanks disabled fields won't submitted forms. hence, says "field required". there property can helpful in kind of situation. use readonly property. replace following line in code instead of disabled property. $('.textfield').prop("readonly", true ); ...