I have a simple form and inside there are two input fields text type.
for example if input has initially value like “Hello” and later on I have changed it to “Hi” and then I submit this form.
I want to see this both values, anyone suggest me please
markup
<form action="index_submit" method="get" name="anil" >
<label for="first_name">first name</label><input type="text" name="first_name" value="" id="first_name">
<label for="last_name">last name</label><input type="text" name="last_name" value="" id="last_name">
<label for="user_name">user name</label><input type="text" name="user_name" value="" id="user_name">
<input type="submit" name="submit" value="submit" id="submit">
<input type="reset" name="reset" value="reset" id="reset">
</form>
js
$(document).ready(function(){
$('form #submit').click(function(){
var oldValue
var newValue
});
})
You could put the initial value in a hidden field as well as the visible one, e.g.:
Then you can do what you like with
greetingandgreeting-originalwhen the form is submitted.