Solved

null or undefined always returned when using getelement by id

Posted on 2014-02-20
1
269 Views
Last Modified: 2014-02-20
I am trying to register a javascript function that validates the prompts the user with a confirm message.  I get undefined (Jquery) and null (JavaScript) when trying to get the text box value.  I have attached the code.  Below is the code.  I have never tried this before.  I am registering the script in the code behind because I need to implement the code in an existing application.
CodeToPost.zip
0
Comment
Question by:edbrinkm
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 41

Accepted Solution

by:
guru_sami earned 500 total points
ID: 39874384
Since you are injecting it from code-behind, you already have access to the TextBox. So you can change the get statement like:
document.getElementById('" + txtAPDateReceived.ClientID + "');")

Open in new window

0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
arrays and radio buttons 10 40
Why is my $_POST not going to results page 10 42
Need help with a query 14 40
Problem in javascript 17 32
Performance in games development is paramount: every microsecond counts to be able to do everything in less than 33ms (aiming at 16ms). C# foreach statement is one of the worst performance killers, and here I explain why.
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

696 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question