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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T03:06:26+00:00 2026-05-31T03:06:26+00:00

I am trying to make my ASP:Listbox throw an event in javascript that will

  • 0

I am trying to make my ASP:Listbox throw an event in javascript that will pick out the selected item and eventually will use that to choose what to do next. But with anything new, I always try and understand what is going on before I try and make it complex.
I am able to get the javascript to connect to the listbox with the

document.getElementByID()

and the variable is populated with the items, but when I try and call on one of the items with

listbox.options[#].value 

I get this error

"Microsoft JScript runtime error: 'listbox' is undefined" 

Please help me figure out why I cant get to the information.

This is just to show a div that contains radio buttons, It is in “var index =” line that the error is occuring.

function showRadios() {
        var listBox = document.getElementById('<%= lbxCheckListLevel3.ClientID %>');
        var index = listbox.options[2].value;
        if (listBox.Options[listBox.Options.SelectedIndex].text != null) {
            var div = document.getElementById("radioDiv");
            div.style.visibility = "visible";
        }

Thanks in advance

EDIT:
Is there any reason that the javascript wouldnt hold the information in the var? It seems that the variable isnt holding its own information. When changing the 2nd line of the code to

var index = listbox

I am still getting the same error, and no information is there when I mouse over it during a pause.

  • 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-31T03:06:28+00:00Added an answer on May 31, 2026 at 3:06 am

    Javascript is case-sensitive… so you will have a lot of corrections to do ..

    function showRadios() {
            var listBox = document.getElementById('<%= lbxCheckListLevel3.ClientID %>');
            var index = listBox.options[2].value;
            if (listBox.options[listBox.options.selectedIndex].text != null) {
                var div = document.getElementById("radioDiv");
                div.style.visibility = "visible";
            }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to make a ASP.NET (C#) poll that will ask a user a
I am trying to make use of jQueryUI AJAX tabs in my ASP.Net Webforms
i'm trying to make my own ExceptionFilter. Out of the box, ASP.NET MVC comes
I'm trying to make use of constants declared in one ASP file in another
I am trying to make sure my ASP.Net library will work under Medium Trust.
I am currently trying to make my existing ASP.NET WebForms application use a Site.Master
I am trying to make the default ASP.NET MVC application use a remote Oracle
I'm trying to make a very simple asp.net page that binds a GridView using
We are trying to make big decisions about our support for classic asp. Does
I'm trying to make a setup program for an ASP.NET web site. I need

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.