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

  • Home
  • SEARCH
  • 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 6364191
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T00:07:57+00:00 2026-05-25T00:07:57+00:00

I am attempting to run this JS function when a user clicks on a

  • 0

I am attempting to run this JS function when a user clicks on a Panel (in a TableCell). This Panel is an element in a Content Page, which is used with the Master Page which has a Content Place Holder. When I try to click on the panel, the following error is thrown:

Microsoft JScript runtime error: Object doesn’t support this property or method

Here is the relevant code for the Master page ASPX:

       <link rel="Stylesheet" href="../includes/styles.css" />
       <script type="text/javascript" language="javascript">
           function swapDirections(control) {
               var main = document.getElementByID('ct100_TableContent_' + control);
               var long = document.getElementById('ct100_TableContent_' + control + '_long');
               var short = document.getElementById('ct100_TableContent_' + control + '_short');

               var mainhtml = main.innerHTML;
               var longhtml = long.innerHTML;
               var shorthtml = short.innerHTML;

               if (mainhtml.length == shorthtml.length)
                   main.innerHTML = longhtml;
               else
                   main.innerHTML = shorthtml;
           }
        </script>

Here is the relevant code for the Content page:

            Panel rigDirections = new Panel();
            rigDirections.CssClass = "clip";
            rigDirections.ID = u.Id.ToString() + "_RD";
            string MainDivRD = rigDirections.ClientID;
            Literal rigDir = new Literal();
            string sshort = "";
            if (u.RigDirections.ToLower().Length > (textCutOFF + 4))
            {
                sshort = Server.HtmlEncode(u.RigDirections.ToLower().Substring(0, textCutOFF).Trim()) + " ...";
                rigDir.Text = "<a class=RD_RA title=\"Click to Expand\" href=\"javascript: swapDirections('" + MainDivRD + "')\">" + sshort + "</a>"; ;
            }
            else
            {
                sshort = Server.HtmlEncode(u.RigDirections.ToLower().Trim());
                rigDir.Text = sshort ;
            }
            string slong = Server.HtmlEncode(u.RigDirections.ToLower().Trim());

            rigDirections.Controls.Add(rigDir);
            cell.Controls.Add(rigDirections);    

And the Content Page ASPX:

      <asp:Content ID="Content1" ContentPlaceHolderID="TableContent" Runat="Server">

       <asp:Panel ID="pnlTable" Width="950" runat="server">

       </asp:Panel>
      </asp:Content>

The error is being thrown on the first line of the function.

I have exhausted my internet searching skills, and I have never used JS before, so if anyone has any ideas I would greatly appreciate them.

Thanks!

badPanda

  • 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-25T00:07:58+00:00Added an answer on May 25, 2026 at 12:07 am

    javascript is case sensitive. document.getElementByID() is not a function, but document.getElementById() is.

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

Sidebar

Related Questions

I'm attempting to write a performance testing function that can take any function, run
Say you have a large PHP project and suddenly, when attempting to run it,
I'm attempting to eliminate leading any leading zeroes in my date when I run
I am attempting to write a user script that makes a cross domain AJAX
I have a page in my application that refreshes some content (a list of
I've been attempting to get DirectDraw to function on a CE5.0 framework for the
I'm attempting to create a page that displays and refreshes an image from a
I am attempting to run a simple node.js webserver using Cygwin. I copied the
I am currently attempting to create an Inno script installer which requests a list
I so often run into this pattern. Can someone please give me a canonical

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.