Solved

Assign a Java Script Variable to ASP.Net Texbox

Posted on 2011-09-23
7
210 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
[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
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
MS Dynamics Made Instantly Simpler

Make Your Microsoft Dynamics Investment Count  & Drastically Decrease Training Time by Providing Intuitive Step-By-Step WalkThru Tutorials.

 
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

Quiz: What Do These Organizations Have In Common?

Hint: Their teams ended up taking quizzes, too.

Question has a verified solution.

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

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…
For those of you who don't follow the news, or just happen to live under rocks, Microsoft Research released a beta SDK (http://www.microsoft.com/en-us/download/details.aspx?id=27876) for the Xbox 360 Kinect. If you don't know what a Kinect is (http:…
There's a multitude of different network monitoring solutions out there, and you're probably wondering what makes NetCrunch so special. It's completely agentless, but does let you create an agent, if you desire. It offers powerful scalability …
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…

734 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