Solved

null or undefined always returned when using getelement by id

Posted on 2014-02-20
1
265 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
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

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

In Part 1 (http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/A_7849-Hex-Maze.html) we covered the hexagonal maze basics -- how the cells are represented in a JavaScript array and how the maze is displayed.  In this part, we'…
Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
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…

705 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now