Solved

Assign a Java Script Variable to ASP.Net Texbox

Posted on 2011-09-23
7
205 Views
Last Modified: 2012-05-12
How can I declare a variable in Java Script that is linked to ASP.Net Textbox.

For example

 var VariableName = textbox1.text ??

Thanks,
Jeff
0
Comment
Question by:jeffreyjseaman
7 Comments
 
LVL 10

Accepted Solution

by:
Chad Smith earned 250 total points
ID: 36590856
var variable = document.getElementById("V_DLEAVE").value
0
 

Author Comment

by:jeffreyjseaman
ID: 36592583
What is V_DLEAVE ?
0
 
LVL 14

Assisted Solution

by:binaryevo
binaryevo earned 125 total points
ID: 36593891
if your familiar with query, you can use the following:

var variableName = $("#textbox1").val();
0
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
LVL 10

Assisted Solution

by:Chad Smith
Chad Smith earned 250 total points
ID: 36593966
Sorry V_DLEAVE should be replaced by the ID of your textbox
0
 
LVL 17

Assisted Solution

by:sonawanekiran
sonawanekiran earned 125 total points
ID: 36595111
Use jquery. U have more adv over javascript. U can assign value to javascript variable in couple of ways:
1) var ur_var=$("#<%=textbox1.ClientID%>").val();

OR

2) assign class to textbox e.g. CssClass="txtclass" & ten use below jquery


var ur_var=$(".txtclass").val();
0
 

Author Comment

by:jeffreyjseaman
ID: 36595276
Ok thanks i will try that. I would prefer Jquery
0
 

Author Closing Comment

by:jeffreyjseaman
ID: 37250862
partilly worked
0

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Summary Displaying images in RichTextBox is a common requirement with limited solutions available. Pasting through clipboard or embedding into RTF content only support static images.  This article describes how to insert Windows control objects int…
It seems a simple enough task, yet I see repeated questions asking how to do it: how to pass data between two forms. In this article, I will show you the different mechanisms available for you to do just that. This article is directed towards the .N…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

707 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

12 Experts available now in Live!

Get 1:1 Help Now