Solved

Div or Input into TextBox

Posted on 2013-12-25
4
530 Views
Last Modified: 2013-12-28
I have already the solution to get client time here .

My next problem that I need to get help is how to populate of either value into aspx TextBox using VB.Net or C#:

$('div#result').text(theFullDate);
$('input#time').val(theFullDate);


Many Thanks.
0
Comment
Question by:JimiJ13
[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
  • 2
4 Comments
 
LVL 11

Assisted Solution

by:Gregory Miller
Gregory Miller earned 200 total points
ID: 39739579
The DIV reference will put the value between the <div></div> tags with the id='name'

The INPUT reference will insert the value into the textbox with the name='time'

Not exactly certain what your question is.
0
 
LVL 53

Accepted Solution

by:
Scott Fell,  EE MVE earned 300 total points
ID: 39739580
I am not a  .net developer, however, your serverside code runs first on the server, then the html renders, then javascript/jquery is run.   This might happen fast enough that you can't tell the difference, but if you ran it in slow motion you would see a big difference.

All you need to do is to label your form control so it renders with at least a name or id.  What counts is how the control renders.


If your form control renders as <input id="date" name="date"> then your jquery would be $('input#date').val(theFullDate);   Or if you want to use name, $("input[name='date']").val(theFullDate);
0
 

Author Comment

by:JimiJ13
ID: 39739742
Hello Padas/Technodweeb,

Now I know why I can't pick up the value because my TextBox name changes when rendered in html like:
INPUT#ctl00_PageContent_myTimeTextBox instead of INPUT#myTimeTextBox

The only issue I at the moment am that, it cannot work inside the Ajax Update Panel.


Thanks.
0
 

Author Closing Comment

by:JimiJ13
ID: 39744264
Thanks you guys for the enlightenment.
0

Featured Post

Containers and Docker for Everyone

Containers are an incredibly powerful technology that can provide you and/or your engineering team with huge productivity gains. Using containers, you can deploy, back up, replicate, and move apps and their dependencies quickly and easily.

Question has a verified solution.

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

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:…
Parsing a CSV file is a task that we are confronted with regularly, and although there are a vast number of means to do this, as a newbie, the field can be confusing and the tools can seem complex. A simple solution to parsing a customized CSV fi…
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…

688 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