I want to make POST Ajax calls when users click on text links.
One way to do it is to create many forms and make the submit button a text link. Then with jQuery I will fetch the variables from the form and submit them with Ajax.
This will create something like the following:
<form><input type="hidden" name="unique-id" value="1"><a href="" class="submitForm"></form>
<form><input type="hidden" name="unique-id" value="2"><a href="" class="submitForm"></form>
<form><input type="hidden" name="unique-id" value="3"><a href="" class="submitForm"></form>
Now with jQuery I will use .click() Event handler and send a POST request with the "unique-id" value (from the scope in which the link click was from).
It looks very complicated and messy and I was wondering if there is a better way to do that.
Thanks
Joel