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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T14:31:16+00:00 2026-06-04T14:31:16+00:00

I am try to get the values from the selected row and pass them

  • 0

I am try to get the values from the selected row and pass them through $.getJSON as parameters. I can get the value, however, when I click on the link strange characters appear before and after the value. The character in the link appears as %OA++++++++++value+++++++%0A.

Here is my code

var className='';
var Section='';
$('#listsubject tr').click(function () {
            var th = $(this);
            var td = $(this).find('td');

            $.each(td, function (index, item) {
                if (index == 2) className = item.innerHTML;

            });


 $.getJSON('@Url.Action("getStudentList/","Student")',
                { classname: className
                }, function (data) {
   alert('test');
});

Kindly help me. Am stuck here

Thanks in advance

EDIT

when i try the code

$.getJSON('@Url.Action("getStudentList/","Student")',
                    { classname: className,
                      section:'A'
                    }, function (data) {
       alert('test');
    });

in the link the section part shows fine, only problem is with the classname

UPDATE

fiddle link
http://jsfiddle.net/gordon/vzTDc/2/

  • 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-04T14:31:17+00:00Added an answer on June 4, 2026 at 2:31 pm

    Try this. I think its OK now.

    var className = '',
        Section = '';
    
    // you were trying with $('#listsubject tr'), but first tr has no td
    // so click should bind with tr from 2nd
    // so correct selector will be $('#listsubject tr:gt(0)')
    
    $('#listsubject tr:gt(0)').click(function() {
        var th = $(this);
        var td = $(this).find('td');
        $.each(td, function(index, item) {
    
            // As you have 2 td with in each row, so the index will be 0 and 1
            // not 2 and 3
    
            if (index == 0) {
                className = $.trim($(item).text()); // $.trim() will remove spaces
            }
            if (index == 1) {
                Section = $.trim($(item).text());
            }
        });
        console.log('ClassName: ' + className + ', Section: ' + Section);
        $.getJSON('StudentMarks/getSubjectGrading', {
            classname: className,
            section: Section
        }, function(data) {
            alert(data);
        });
    });
    

    DEMO

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

Sidebar

Related Questions

How can I get the selected value from DetailsView to a textbox? So far
I have a WPF ComboBox named cbFileSize. I try to get is selected value
Im getting a -1 value when i try to get the selected item position
Using following code I try to get updated list of checkbuttons' corresponding text values,
I try to get to a page straight from Bash at http://www.ocwconsortium.org/ . The
I want to read a sequence of bytes from my accelerometer. I can't get
I am changing a variable based on the value selected from a dropdown. I
I have a simple function which tries to get a value from an Obout
I try get a my attribute inside Fancybox, and I get when I use
I try to get all WPF window controls collections. In other words i try

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.