Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > Displaying Date Time in an input box

Reply
Thread Tools

Displaying Date Time in an input box

 
 
Jerry
Guest
Posts: n/a
 
      02-06-2004
With the following code I am trying to simply set and display the current date time in an input box. The input box will not accept a variable that contains any spaces (i.e., a space between date and time). It works if I hardcode a date time, but I need the current date time. The code also works as long as it is not within an input box (see 3rd line below)

<tr><td align="right"><strong>Start Time:</strong></td><td align="left"><input type="Text" name="Start_Time" value=<% =now %> /></td> *THIS ONLY DISPLAYS DAT
<td><% =now %></td> *THIS DISPLAYS BOTH DATE AND TIM
</tr

Any ideas on how to accomplish this

Thanks
Jerr
Any ideas
 
Reply With Quote
 
 
 
 
Steven Burn
Guest
Posts: n/a
 
      02-06-2004
<%
Function GetItFromHere()
Dim strDateandTime
strDateandTime = now 'get date and time
strDateandTime = Trim(strDateandTime) 'remove spaces
GetItFromHere = strDateandTime 'pass it to the function returned
End Function
%>

<input type="text" value="<%GetItFromHere%>">

--
Regards

Steven Burn
Ur I.T. Mate Group
www.it-mate.co.uk

Keeping it FREE!

Disclaimer:
I know I'm probably wrong, I just like taking part ;o)


Jerry <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> With the following code I am trying to simply set and display the current

date time in an input box. The input box will not accept a variable that
contains any spaces (i.e., a space between date and time). It works if I
hardcode a date time, but I need the current date time. The code also works
as long as it is not within an input box (see 3rd line below).
>
> <tr><td align="right"><strong>Start Time:</strong></td><td

align="left"><input type="Text" name="Start_Time" value=<% =now %> /></td>
*THIS ONLY DISPLAYS DATE
> <td><% =now %></td> *THIS DISPLAYS BOTH DATE AND TIME
> </tr>
>
> Any ideas on how to accomplish this.
>
> Thanks,
> Jerry
> Any ideas



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Displaying a UTC date-time from DB in local-time in a GridView Kevin Frey ASP .Net 0 11-30-2006 03:18 AM
Width of text input box vs. password input box cjl HTML 1 10-31-2005 11:46 AM
Off Topic: Width of text input box vs. password input box cjl Javascript 7 10-30-2005 10:11 PM
hide the input box or change the color of input box in html ashutosh Java 3 06-16-2005 02:21 PM
Date, date date date.... Peter Grison Java 10 05-30-2004 01:20 PM



Advertisments