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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.