hang up the processor on click on the link in which you send request, namely the value of only one field. The answer lies in the question itself. You can do the following: give the names of hidden fields almost the same as the links with the only difference - in the beginning add the letter h. Then, after clicking on the link, we will determine the name of the clicked link and form the name of the corresponding hidden field programmatically. The sending code is like this:
<html> <head> <script type="text/javascript" src="jquery.js"></script> <script type="text/javascript"> $(document).ready(function(){ $('#error').hide(); var hiddenname=''; $("#container").click(function (e) { if (e.target.id!='') {hiddenname = e.target.id; hiddenname='h'+hiddenname;} var x = $(hiddenname).val();//получаем в переменную х значение из скрытого поля $.ajax({ type: "POST", url: "test.php", data: "x="+x, success: function(html){ $("#error").append(html); $("#error").slideDown('slow'); } }); }); }); </script> </head> <body> <div id="error"></div> <div id="container"> <form> <a href="#" id="link1">link1</a> <input type=hidden id="hlink1"><br><br> <a href="#" id="link2">link2</a> <input type=hidden id="hlink2"><br><br> <a href="#" id="link3">link3</a> <input type=hidden id="hlink3"><br><br> <a href="#" id="link4">link4</a> <input type=hidden id="hlink4"><br><br> </form> </div>
And then on the server you take out the value of the variable x from the POST array