Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problem with Date

Status
Not open for further replies.

kathymac

Programmer
Nov 25, 2009
7
CA
Hello

I need to get the value of my InvoiceDate and then add 1 month to it and display it in the input box DueDate formatted as mm/dd/yyyy.

This is not working out for me. Could someone please tell me what I have done wrong.

Code below:
<tr>
<td class="InvoiceStdTextBold">
Invoice Date:
</td>

<td class="InvoiceStdText">
<input class="TableNoBorder" type="text" name="InvoiceDate" value=%%PurchaseDate, {0:d}%%>
</td>
</tr>

<tr>
<td class="InvoiceStdTextBold">
Due Date:
</td>

<td class="InvoiceStdText">
<script language="JavaScript">
function GetDueDate()
{
var dInvoiceDate = document.Form1.InvoiceDate.value;
var myDate = new Date(dInvoiceDate);
myDate.setMonth(myDate.getMonth() + 1);

document.Form1.DueDate.Value = mydate;
}
</script>
<input class="TableNoBorder" type="text" name="DueDate">
</td>
</tr>
 
Hi

JavaScript is case sensitive.
Code:
document[teal].[/teal]Form1[teal].[/teal]DueDate[teal].[/teal][highlight]v[/highlight]alue [teal]=[/teal] my[highlight]D[/highlight]ate[teal];[/teal]
Of course, the date text will not be formatted as you wish, but searching the web will lead you to some good code libraries.


Feherke.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top