Solved

Div or Input into TextBox

Posted on 2013-12-25
4
521 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 52

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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

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:…
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…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

730 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