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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T20:27:11+00:00 2026-05-15T20:27:11+00:00

I am learning JQuery. I got s Select Tag with some options in a

  • 0

I am learning JQuery.
I got s Select Tag with some options in a very simple form like this:
(The form was generated by the Server and the values in each Option was retrieved from the database.)

<select name="data[Site1][quotenumber]" id="data[Site1][quotenumber]"> 
<option name="editquote" value="[29,1]">1</option> 
<option name="editquote" value="[24,2]">2</option> 
</select>

To get the value from the option selected, I used this code:

var whatValue = $('#data\\[\\Site1\\]\\[quotenumber\\] :selected').val();
alert(whatValue);

Now that I can get the value from the Select Tag, but the returned value was like an array, i.e. [29,1].
What is the best way to get the two values in each option?
I mean to print them out like this way:
The first value is 29, and the second one is 1.

Please help if you could

  • 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-15T20:27:12+00:00Added an answer on May 15, 2026 at 8:27 pm

    This should work:

    var whatValue = $('#data\\[\\Site1\\]\\[quotenumber\\] :selected').val();
    alert(whatValue);
    
    eval('var arr = ' + whatValue);
    alert('The first value is: ' + arr[0]);
    alert('The second value is: ' + arr[1]);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

After learning about jQuery and the whole AJAX thing, I got very excited. I
As part of learning jQuery, I decided to do a simple tic-tac-toe game in
I am learning JQuery, and I have checked out that JQUery has got a
I've just been learning some jQUery to get a basic image gallery going on
I'm practicing my jQuery skills (ok, learning too) and experienced an issue. I got
I am just learning jquery, so this might be something easy. I am trying
I am learning jQuery right now and am looking to validate form fields with
I'm learning jQuery and can't figure this out: Here's the HTML <a id=myid name=myid
Hi I am still learning Jquery and have a problem accessing form elements. My
Beyond the official documentation, are there any recommended resources for learning to build jQuery

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.