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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T06:22:52+00:00 2026-06-15T06:22:52+00:00

My javascript dont seem to like the var divTag = ‘#’ + ratinglistid +

  • 0

My javascript dont seem to like the var divTag = '#' + ratinglistid + " > select[name=SelectedValue] > option:selected";

I couldn’t find the answer searching.. Sorry for the messed up formatting, couldn’t get it to go away.

 Script:

<script>
    function doSubmit(form, myRating, ratinglistid){
        var divTag = '#' + ratinglistid + " > select[name=SelectedValue] > option:selected";
        var ratingValue = $(divTag);
        $.ajax({
            type: "GET",
            url: "/RatingLists/Done",
            data: ({
                myrating: ratingValue,
                myRatingListId: ratinglistid
            }),
            contentType: "application/json; charset=utf-8",
            dataType: "json"
        });
    }
</script>

Html I want to get value from:

    <div id='2'>
    <input type="hidden" name="RatingListId" value="2"/>
    <select id="SelectedValue" name="SelectedValue" onchange="doSubmit($(this).parents(&#39;form&#39;),2);"><option value="1">Inget intresse, tas bort</option>
    <option value="2">Svagt intresse, sparas</option>
    <option selected="selected" value="3">Intresserad-ingen kontakt &#228;n</option>
    <option value="4">4-Intreserad-vill ha kontakt</option>
    <option value="5">5-Vill byta!</option>
    <option value="100">6-Avvaktar v&#228;rdar</option>
    </select>
    </div
  • 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-15T06:22:53+00:00Added an answer on June 15, 2026 at 6:22 am

    It could not evaluate inside get call so I had to do it like this:

    var divTag = '#' + ratinglistid + " > select[name=SelectedValue] > option:selected";
    var ratingValue = $(divTag).val();
        $.ajax({
                    type: "GET",
                    url: "/RatingLists/Done",
                    data: ({
                        myrating: ratingValue,
                        RatingListId: ratinglistid
                    }),
                    contentType: "application/json; charset=utf-8",
                    dataType: "json",
                    success: OnSuccess(ratinglistid),
                    error: function () {
                        var id = ratinglistid;
                        $('#' + id + "tbody td").hover(function () {
                            $(this).parents('tr').addClass('highlight');
                        }, function () {
                            $(this).parents('tr').removeClass('highlight');
                        });
                    }
                });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following JavaScript (I'm using jQuery): function language(language) { var text =
I would like to validate residence address in the JavaScript using regex, but I
I don't know much about Javascript, and this function I wrote doesn't seem to
I have a form that looks like the following: <input type=text name=item[101][0][date] value=2012 />
Such a simple thing I need to do, and it doesn't seem like any
I'd like to store a JavaScript object in HTML5 localStorage , but my object
I don't understand this behavior in javascript for inheritance I've always seen it defined
I don't want to use a couple of javascript plugins for IE 6/7. But
I am new to javascript so sorry I don't know very much. I have
It's not that I don't have access to javascript, of course. In most of

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.