Solved

null or undefined always returned when using getelement by id

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

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Media.Imaging 1 18
asp.net mvc5 6 12
Problem with SelectList in .NET MVC application 1 11
Linq asp.net mvc 13 6
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
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…

813 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

14 Experts available now in Live!

Get 1:1 Help Now