I've following DOM structure
<form name="address_form" method="post">
<input type="hidden" name="action" value="update_address_details">
<input type="hidden" name="latitude" value="52.367659">
<input type="hidden" name="longitude" value="-0.409539">
<input type="hidden" name="map_zoom_point" value="14">
<input type="text" name="address" value="" value="brington"> //visible element
<input type="submit" name="submit" value="Update"/> //visible element
</form>
I'm showing above form
to user with some default input data available in DB below this form I'm showing an OpenLayers map based on latitude
,longitude
and map_zoom_point
.
If user move marker image on OpenLayers map then hidden fields in the above form will be automatically updated, I want capture this change using jQuery. If I use below code,
$('form[name=address_form] input').on('change keypress',function() {
console.log('something');
});
then console.log
only prints if user modifies text in address field otherwise it won't print the log message even hidden fields get changed.