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 4543572
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T15:33:00+00:00 2026-05-21T15:33:00+00:00

I have a around 8 jQuery star rating in my page: <input class= auto-submit-star

  • 0

I have a around 8 jQuery star rating in my page:

<input class= "auto-submit-star" name="star2" type="radio" class="star"/>
<input class= "auto-submit-star" name="star2" type="radio" class="star"/>
<input class= "auto-submit-star" name="star2" type="radio" class="star" checked="checked"/>
<input class= "auto-submit-star" name="star2" type="radio" class="star"/>
<input class= "auto-submit-star" name="star2" type="radio" class="star"/>

What I want to do is that when a user clicks on the rating, it does a post back to the database (MySQL) and update some data. I know there is a callback function for this star rating that looks something like this:

$('.auto-submit-star').rating({
    callback: function(value, link){
        $.post("ajax.php", {name: unknown, val: value});
    }
})

The question is that in this callback function, how do I get the name. Which is star2 in the example above? Can someone also give me an example of a doing a post

;

  • 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-05-21T15:33:01+00:00Added an answer on May 21, 2026 at 3:33 pm

    To get an attribute of the clicked element you want to use the .attr(string) function.

    $('.auto-submit-star').rating({
        callback: function(value, link){
            $.post("ajax.php", {name: unknown, val: $(this).attr('name')});
        }
    })
    

    EDIT: I didn’t realize the value was provided as a callback param.

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

Sidebar

Related Questions

I was trying to get my head around jQuery's Ajax. I have a page
In my web application I have around 10 headings with same class name, so
I have played around and implemented JQuery cycle to create a carousel with images,
I have been testing and playing around with jquery date picker below. http://jqueryui.com/demos/datepicker/ on
I have around 9 web parts and 3 pages to be deployed. Each page
I'm trying to use form submit with jquery without a page refresh as demonstrated
I have been playing around with jQuery for a bit now, and am really
I have around ten html pages all have search tab ,only one page is
I have around 100 items in a jQuery Mobile listivew. Is it possible to
Can't get my head around this Jquery problem I have.. I've been looking around

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.