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
Solved

Div or Input into TextBox

Posted on 2013-12-25
4
517 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
  • 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

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

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

Introduction This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks. Background I had to provide a way for user…
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

839 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