I\'ve a form.
add two hidden input to your form and use jQuery to change their value
Try this:
var pos = $('#name').position();
$("form").append('<input type="hidden" name="name_position" value="' + pos.left + ',' + pos.top + '" />');
Then read name_position
value from the POST data in the server side code.
The easiest way would be to use a hidden input field and use jQuery to set the value for this input field or these input fields in your case.
HTML:
<form action="inc/genxml.php" method="post">
<input id="nameTxt" name="name" type="text" value="test"/>
<input id="posLeft" name="posLeft" type="hidden" />
<input id="posRight" name="posRight" type="hidden" />
<button id="nameSave" class="left">Save</button>
</form>
JS:
$('#nameSave').click(
function() {
var pos = $('#name').position();
$('#posLeft').val(pos.left);
$('#posRight').val(pos.right);
}
);