Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

null or undefined always returned when using getelement by id

Posted on 2014-02-20
1
Medium Priority
?
273 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 2000 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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
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…
Suggested Courses

610 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