passing a variable to ajax when a specific button is clicked.
Hi,
I have a PHP script that populates a split list of locations on a jQuery Mobile page. When you click on any location in the list, I want it to take you to a new page that displays the address and contact information.
Everything is working except I can't figure out a way to get Javascript to recognize the specific button in the list that was clicked in order to have the ajax-loaded PHP file display the proper result.
I tried creating a form with each button and a hidden input called "lid" (tried both ID of "lid" and CLASS of "lid") and then using .closest() to reference that form / input when the link is clicked, but this did not work.
I also tried creating urls for each button with the variable tagged onto the end (#display?lid=123) but url variable information does not seem to get passed when the button is clicked.
I am not sure if my syntax is wrong or if there is a better way. Without jquery I would just have a form (or multiple forms) and use a standard submit. - Essentially, I am trying to mimic this type of behavior only have it pass the form variable into a Javascript to load the content using Ajax.
Thank you very much,
J