php - How to find which input field is modified? -
i have couple of input field , values in them. projected user. user can modify these values , submit them. when submitted, need check input field modified.
i can compare previous fields , current fields , check. trying find more optimized way this. can use javascript, php, jquery , html tricks
<input id="input1" value="somevalue" type="text"> <input id="input2" value="somevalue" type="text">
script:
$('input').on('change',function(){ var id = $(this).attr('id'); alert("input field modified : id = " + id); });
Comments
Post a Comment