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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T15:03:16+00:00 2026-05-28T15:03:16+00:00

I have a form where users can store and edit their skills in different

  • 0

I have a form where users can store and edit their skills in different languages.
I´m using a plugin called “raty” to let users set ratings on their language skills. Spring is used for backend. I store the language ratings in a String[] called languageRatings.

The actual setting of skills is not a problem, however I run into problems when I want to let users edit their language skills. The issue is that the name for the form input is set by the lib provided by raty itself, which means that the input name “languageRatings” does not exist when Spring populates the input fields.

A small example of how raty is initialized:

$('#star').raty({
  scoreName: 'languageRatings'
});

<div id="star"></div>

In an attempt to get around this issue, I created a new hidden input:

<form:hidden path="languageRatings" id="hiddenRatings"/>

My thought was to get Spring to populate this input instead, allowing me to use fetch the values from this input element AFTER the correct names has been set by raty.

The hidden field is populated with an array containing ratings like so:
{5, 4, 2}. I´m not very good with Jquery 🙁 I tried doing like this, but it prints the entire string instead of each array element

$(document).ready(function() {
    var ratings = $('#hiddenRatings').val();
    $.each(ratings, function(index, value) { 
      console.log(index + ': ' + value); 
    });
});

produces

0: {
1: 5
2: ,
3:  
4: 3
5: ,
6:  
7: 2
8: }

How can I extract the values in this array?

  • 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-28T15:03:18+00:00Added an answer on May 28, 2026 at 3:03 pm

    As your value is "{5, 4, 2}" you can do something like:

    var val = $('#hiddenRatings').val(), // "{5, 4, 2}"
        arr = /\{(.*)\}/.exec(val)[1].split(", ");
    
    $.each(arr, function (index, value) {
        console.log(index + ': ' + value);
    });
    

    The RegEx strips the curly brackets and the result is then split by ", ", leaving you with an Array containing ["5", "4", "2"].

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

Sidebar

Related Questions

I have a form where users can modify a collection of objects using a
Let's say I have a form where users can search for people whose name
I have a form in witch users can add their working hours view them
I have a form which users can add controls to and when they right
I have a form where users can add input fields with jQuery. <input type="text"
I have a form where my users can register to my site. They fill
I have a form in my django app where users can upload files. How
We have got a setup where users can either use a web-based form or
I have a form a user can enter their name, then it will add
In our web application, I am allowing users to edit their profiles, using a

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.