Log in

View Full Version : Date script



lnxfrk
05-25-2011, 05:28 AM
Hi,

Thank you in advance for your support.

I was wondering if it's possible to add to the following scripts where the 2nd script adds 1 year from the current date automatically when the form that it's part of is loaded. By default, they both load with the current date.:

<script>DateInput('issue_date', true, 'MON-DD-YYYY')</script>
<script>DateInput('valid_thru', true, 'MON-DD-YYYY')</script>

so any date chosen on the first script adds one year to the second script automatically instead of having to choose it.

Thank You.

Bucketbee
06-07-2011, 04:01 PM
Hi,

Thank you in advance for your support.

I was wondering if it's possible to add to the following scripts where the 2nd script adds 1 year from the current date automatically when the form that it's part of is loaded. By default, they both load with the current date.:

<script>DateInput('issue_date', true, 'MON-DD-YYYY')</script>
<script>DateInput('valid_thru', true, 'MON-DD-YYYY')</script>

so any date chosen on the first script adds one year to the second script automatically instead of having to choose it.

Thank You.


Is this any help?

<html>
<head>
<script type="text/javascript">
function displayDate()
{
document.getElementById("demo").innerHTML=Date();
}
</script>
</head>
<body>

<h1>Time and Date</h1>
<button type="button" onclick="displayDate()">Display Date</button>

</body>
</html>

Hope it helped! :D