I've a form.
<form action="inc/genxml.php" method="post">
<input id="nameTxt" name="name" type="text" value="test"/>
<button id="nameSave" class="left">Save</button>
</form>
And a div element #name
When I click the save button, I want to pass the position of the div #name to the form action file. To get the position, I'm using jQuery .position().
Something like below. (which just prints out the coordinates)
$('#nameSave').click(
function() {
var pos = $('#name').position();
alert("left: " + pos.left + ", top: " + pos.top );
}
);
I want to pass the coordinate values (pos.left & post.top) to the form action file (in this case to the file genxml.php).
How should I do that?