Solved

Div or Input into TextBox

Posted on 2013-12-25
4
507 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:Technodweeb
Technodweeb earned 200 total points
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
Thanks you guys for the enlightenment.
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

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…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

763 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

7 Experts available now in Live!

Get 1:1 Help Now