Jump to content

Passing multiple variables with jQuery


Miko

Recommended Posts

Hello,

 

Not sure if i'm asking this on the correct location :D

I'm quite new with jQuery so don't hit me if I'm asking something stupid  :P.

I'm trying to pass data to my mySQL database, but I'm doing that 2 jQuery scripts:

 

 

      User comes on my page where there is a list with some values, e.g 530, 532, 534 etc etc ..

      User clicks on one of them, this link is using the jQuery to get another php file which get's the data from my DB and list it below the first list, here's the code for this:

      $('#letter-e a').click(function(){
        $.get('e.php', {'depot': $(this).text()},function(data){
          $('#dict').html(data);
        });
        return false
      });

 

      So the second list is another step that can't be avoided to get the final result. In other words, i'ts another list where the user has to chose one of the items from the list to see the final result, I've added this code inf the 'e.php' file:

 

 

      $('#letter-f a').click(function(){
        $.get('f.php', {'date': $(this).text()},function(data){
          $('#entry2').html(data);
        });
        return false
      });

 

 

 

The problem is that my 'f.php' only gets 1 variable value, but I'll need 2 or more (maybe in the futur), someone knows how to pass multiple variables to a php file using jQuery?

 

Thanks Smile

Link to comment
https://forums.phpfreaks.com/topic/180261-passing-multiple-variables-with-jquery/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.