Kindly help .. Assigning system date to text box.

Results 1 to 3 of 3

Thread: Kindly help .. Assigning system date to text box.

  1. #1
    nath Guest

    Default Kindly help .. Assigning system date to text box.

    I have 2 text boxes on a .ASP screen. The first text box is user enterable date and the second text box is disabled and once the submit button is hit the second text box should be populated with the system date & time. I have written code in Javascript to populate the second text box with system date & time. But it gives me some vague error. I am not able understand whats the mistake I am doing.<BR>I have written the code like this.<BR><BR>&#060;HTML&#062;<BR>&#060;HEAD&#062;< BR>&#060;SCRIPT LANGUAGE="JavaScript"&#062;<BR> function form_Validations(theform) {<BR> <BR> //Code to validate the first text box&#039s content. Works fine.<BR><BR> // Code to assign system date to the second text box. Gives error somewhere else.<BR> dim today = New Date();<BR> theform.txt_secondbox.value = today;<BR> return True;<BR> }<BR>&#060;/SCRIPT&#062;<BR>&#060;Body&#062;<BR>&#060;Form action=a.asp name=form1 method=post onsubmit="return form_validation(this)"&#062;<BR><BR>&#060;/form&#062;

  2. #2
    Join Date
    Dec 1969

    Default RE: Kindly help .. Assigning system date to text b

    The easiest thing to do would use vbscript&#039s Now() function. <BR><BR>In the text box:<BR><BR>&#060;input type="text" name="whatever" value="&#060;%=Now()%&#062;"<BR>or<BR>if you are assigning this value after they click submit use:<BR>Request("whatever") = Now()<BR>

  3. #3
    nath Guest

    Default Thank u Erica

    Thank You

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts