Hello @kartik,
You can't change the field's value and just do a simple form submission. There's a few ways to do this:
Option 1 - Hidden fields
So make a field, disable it, and add a hidden field. Disabled fields are never successful, although the user will be unable to change the field value and many browsers will change the styling of the field automatically
<input type="text" name="name" value="John" disabled>
<input type="hidden" name="name" value="Doe">
Option 2 - Change the value on submit
As you mentioned, you can always change the value when the form is submitted. The below listener will capture the form submitt Using jQuery since you asked it that way
$("form").on( "submit", function( event ) {
event.preventDefault();
$('input[name="name"]').val('Doe');
$("form").submit();
});
Hope it helps!!
Thank You!