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
Solved

null or undefined always returned when using getelement by id

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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Binding a Grid in Javascript 5 43
jquery + C#.net radiobuttonlist 3 30
Need syntax help building hyperlink 2 25
On Load function does not trigger on iPhone 4 32
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
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…

856 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