Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8276479
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T08:23:11+00:00 2026-06-08T08:23:11+00:00

I want to send multiple arguments to JQUERY event functions.For sending one data i

  • 0

I want to send multiple arguments to JQUERY event functions.For sending one data i put it in value attr in html code.

<li id="<?php echo 'v'.$value['vehicleid'] ?>" value="<?php echo $value['vehicleid']; ?>" >

And get data in JQuery event function with $(this).val() But i don’t know how can i pass multiple php data to JQuery event function!
these data are dynamic and produced by php code.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T08:23:12+00:00Added an answer on June 8, 2026 at 8:23 am

    You cannot use val() on an li it is supposed to be used on form elements like input for which there is a valid attribute called value

    For an li you can use data attributes

    <li id="<?php echo 'v'.$value['vehicleid'] ?>" data-vehicleid="<?php echo $value['vehicleid']; ?>" >
    

    and use:

    var vehicleId = $(this).data('vehicleid');
    

    For passing multiple data you can seperate each id with some char like “-“:

    <li id="<?php echo 'v'.$value['vehicleid'] ?>" data-vehicleids="<?php echo $value['vehicleid1']. '-' .$value['vehicleid2']; ?>" >
    

    which should produce something like:

    <li id="1234" data-vehicleids="1234-3456-5678" >
    

    then do

    var vehicleIdsArray = $(this).data('vehicleids').split('-');
    

    just make sure charachter used for seperation is not used for vehicle ids

    This should help you:

    <ul id="list">
    <li data-vehicleid="1234" data-vehiclename="renault" data-vehicle-color="silver">Renault</li>
    </ul>
    

    $(document).ready(function(){
      $('ul#list li').click(function(e){
        var vehicleId = $(this).attr('vehicleid');
        var vehicleName = $(this).attr('vehiclename');
        var vehicleColor = $(this).attr('vehiclecolor');
        return false;
      });
    });
    

    Quote from Resig:

    I think what is most enticing about this whole specification is that
    you don’t have to wait for any browser to implement anything in order
    to begin using it. By starting to use data- prefixes on your HTML
    metadata today you’ll be safe in knowing that it’ll continue to work
    well into the future. The time at which the HTML 5 validator is
    integrated into the full W3C validator your site will already be
    compliant (assuming, of course, you’re already valid HTML 5 and using
    the HTML 5 Doctype).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to send an image from one android device to one or multiple
I have multiple forms, and I want to send classnames of these HTML form's
Objective: I want to send multiple images using multipart/form-data. Below is a snippet of
I want to send keystrokes to multiple processes. For example, if I press 1,
I want to send SMS messages to multiple numbers in my database based on
In my application i want send a email to one account.in one button click
Hello Sir i want send list of data to php server i use following
How can I send multiple http requests sequentially to a server ? I want
I have multiple classes, all of which I want to send an identical message
i have this code for sending data var test={imagename:apple.jpg,x:13,y:33}; $.ajax({ type: POST, url: some.php,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.