I am working on the webpage which contains a input field that needs to be changed programmatically using stored string into the php variable.
This is my JQuery code and it is doing what i need.
$(function(){
$('.start').click(function(e) {
var currentPage = "<?php echo $name;?>";
$('input').val(currentPage);
$('.textfield').prop("disabled", true );
$('.textfield').css('cursor','not-allowed');
});
});
When I click start button name is inserted into the input element, but when i click submit button, error message popup that "Field is required". My question is, why changed input value doesn't work. If I add or remove letter then submit button is working and there is no field message popup.
Thanks
$('input').val(currentPage).change();