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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T02:34:30+00:00 2026-05-26T02:34:30+00:00

I posted on here before and received a great answer – however on further

  • 0

I posted on here before and received a great answer – however on further use, the code is showing errors in Firebug and not working properly in testing.

Original question.

JSFiddle solution

Firebug error shows: document.getElementsByName(“licenseAgreement”)[0] is undefined (line 1)

Any help would be wonderful.

  • 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-26T02:34:31+00:00Added an answer on May 26, 2026 at 2:34 am

    Numerous issues. The most likely main issue is that you are running your code before the page has loaded and thus the licenseAgreement object is not yet valid. Here’s a summary of the things you should change.

    First, this code won’t work in IE before IE9 for several reasons. getElementsByName isn’t properly supported in IE and addEventListener isn’t supported at all before IE9. You will have to use attachEvent with IE and addEventListener in other browsers. See the jsFiddle below for code to do that.

    Second, I’d suggest you change to document.getElementById() and give your targeted elements an id value instead of name value. This will get you the exact element you want and is supported cross browser. See the jsFiddle below for how to use getElementById instead.

    Third, you don’t show us the actual working page, but my guess would be that you are running your code to attach an eventListener before the page has finished loading which would mean that it can’t find the licenseAgreement object because it hasn’t yet been parsed and loaded into the page. Just a guess since you haven’t shown us the actual page that fails. You can either move your intialization code to the end of the HTML body or you can not call it until after the page has loaded by hooking a page load event and calling it from there. Your jsFiddle may work because you have specified in the jsFiddle that you don’t want your code to run until the page has loaded (a jsFiddle feature).

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

Sidebar

Related Questions

Before I start, yes this is a homework. I would not have posted here
Yesterday I posted a question here ( FxCop and Code Analysis Rules ) about
I've seen this question posted here before but I want to get a final
I have posted in here before but all have led to dead ends. First
I know this question has been posted here before, and I've trawled through as
i have questions regarding the shake detection that posted here before, here is a
This question to which I already found the answer is posted here in case
I'm using the method posted here to scroll an NSString across the screen. However,
I found some source code in this thread posted by Rex Logan here on
I posted this question here before but there were no responses. I may have

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.