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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T10:26:01+00:00 2026-06-13T10:26:01+00:00

I have this form with a multi-selection blocks, I am trying to get the

  • 0

I have this form with a multi-selection blocks, I am trying to get the values of each block criteria on click so I can send it a database, but every time I click a block my script is getting the value of all, any ideas?

I created a jsFiddle here: http://jsfiddle.net/creativestudio/Hqbmk/4/

<form action="" method="post" id="postingFeedback">

            <!-- .votes-list -->
            <ul class="vote-list">
                <li class="vote" name="vote1" value="A-value1">
                </li>
                <li class="vote" name="vote1" value="A-value2">
                </li>
                <li class="vote" name="vote1" value="A-value3">
                </li>
                <li class="vote" name="vote1" value="A-value4">
                </li>
                <input name="smileVote" class="is-hidden" data-role="none" value="" />
            </ul><!-- / .votes-list -->

<div class="clear"></div>

            <!-- .votes-list -->
            <ul class="vote-list">
                <li class="vote" name="vote2" value="B-value1">
                </li>
                <li class="vote" name="vote2" value="B-value2">
                </li>
                <li class="vote" name="vote2" value="B-value3">
                </li>
                <li class="vote" name="vote2" value="B-value4">
                </li>
                <input name="smileVote" class="is-hidden" data-role="none" value="" />
            </ul><!-- / .votes-list -->
            <div class="clear"></div>

<div class="clear"></div>

            <!-- .votes-list -->
            <ul class="vote-list">
                <li class="vote" name="vote3" value="C-value1">
                </li>
                <li class="vote" name="vote3" value="C-value2">
                </li>
                <li class="vote" name="vote3" value="C-value3">
                </li>
                <li class="vote" name="vote3" value="C-value4">
                </li>
                <input name="smileVote" class="is-hidden" data-role="none" value="" />
            </ul><!-- / .votes-list -->
            <div class="clear"></div>

<div class="clear"></div>

            <!-- .votes-list -->
            <ul class="vote-list">
                <li class="vote" name="vote3" value="D-value1">
                </li>
                <li class="vote" name="vote3" value="D-value2">
                </li>
                <li class="vote" name="vote3" value="D-value3">
                </li>
                <li class="vote" name="vote3" value="D-value4">
                </li>
                <input name="smileVote" class="is-hidden" data-role="none" value="" />
            </ul><!-- / .votes-list -->
            <div class="clear"></div>

<div class="clear"></div>

            <!-- .votes-list -->
            <ul class="vote-list">
                <li class="vote" name="vote4" value="D-value1">
                </li>
                <li class="vote" name="vote4" value="D-value2">
                </li>
                <li class="vote" name="vote4" value="D-value3">
                </li>
                <li class="vote" name="vote4" value="D-value4">
                </li>
                <input name="smileVote" class="is-hidden" data-role="none" value="" />
            </ul><!-- / .votes-list -->
            <div class="clear"></div>

<div class="clear"></div>

            <!-- .votes-list -->
            <ul class="vote-list">
                   <li class="vote" name="vote5" value="E-value1">
                </li>
                <li class="vote" name="vote5" value="E-value2">
                </li>
                <li class="vote" name="vote5" value="E-value3">
                </li>
                <li class="vote" name="vote5" value="E-value4">
                </li>
                <input name="smileVote" class="is-hidden" data-role="none" value="" />
            </ul><!-- / .votes-list -->
            <div class="clear"></div>

</form>

Here is my JS:

function getValues(){    
    $('#postingFeedback li').on('click', function(event){        
           var $clickedValue = $(this).val($(this).attr("value")); // Retreive "value"
           $(this).siblings('input[name="smileVote"]').val($clickedValue); // Plug smile value into input for database POSTS
    });
}



getValues();
​
  • 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-13T10:26:02+00:00Added an answer on June 13, 2026 at 10:26 am

    value is a reserved attribute, it’s not intended to be used on an li like you’re trying to do. Rename that to something else, like vote:

    <li class="vote" name="vote1" vote="A-value1">
    

    Then get the value by accessing the attribute directly:

    $('#postingFeedback li').on('click', function(event){
        $(this).siblings('input[name="smileVote"]').val($(this).attr('vote'));
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have some models and I want to generate a multi-selection form from this
I have a multi-step order form built in this manner: Step 1: Choose category
I have this form: <%= form_tag posts_path, :method => :get, :class => search_nav do
i have this form to serialize once i click the submit button, <form class=cashier_forms
I have this Form I am trying to upload my image but every time
I have this form. Basically what I want is to send a auto-response with
I have a form where fields get added via JavaScript. This is fairly easy
I have a three-level multi-nested form in Rails. The setup is like this: Projects
I hope I can ask this right. I have a listbox on a form
I've built a multi-select form (from within form_for) like this: <div class=rounded-block quarter-wide radio-group>

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.