Hi,
I have made a forms like this
http://www.sgagrafica.com/index.php?option=com_virtuemart&Itemid=122&vmcchk=1&Itemid=122
Now I would print the TODAY date in a text line (<p> or <div>).
How can I do this?
regards
monak83
I have made a forms like this
http://www.sgagrafica.com/index.php?option=com_virtuemart&Itemid=122&vmcchk=1&Itemid=122
Now I would print the TODAY date in a text line (<p> or <div>).
How can I do this?
regards
monak83
Hi,
try this:
<SCRIPT TYPE="text/javascript">
<!--
// SCRIPT FOR THE "TODAY"
function today()
{
var now,rv;
now = new Date();
var rv =
now.getMonth() + "/" +
now.getDate() + "/" +
now.getYear();
return rv;
}
// -->
</SCRIPT>
try this:
<SCRIPT TYPE="text/javascript">
<!--
// SCRIPT FOR THE "TODAY"
function today()
{
var now,rv;
now = new Date();
var rv =
now.getMonth() + "/" +
now.getDate() + "/" +
now.getYear();
return rv;
}
// -->
</SCRIPT>
But in the HTML code where I shoult put the date? where I can see the date in my form?
<SCRIPT TYPE="text/javascript">
<!--
// SCRIPT FOR THE "TODAY"
function today()
{
var now,rv;
now = new Date();
var rv =
now.getMonth() + "/" +
now.getDate() + "/" +
now.getYear();
return rv;
}
document.write(today());
// -->
</SCRIPT>
<!--
// SCRIPT FOR THE "TODAY"
function today()
{
var now,rv;
now = new Date();
var rv =
now.getMonth() + "/" +
now.getDate() + "/" +
now.getYear();
return rv;
}
document.write(today());
// -->
</SCRIPT>
<SCRIPT TYPE="text/javascript">
<!--
// SCRIPT FOR THE "TODAY"
function today()
{
var now,rv;
now = new Date();
var rv =
now.getMonth() + "/" +
now.getDate() + "/" +
now.getYear();
return rv;
}
document.write(today());
// -->
</SCRIPT>
<!--
// SCRIPT FOR THE "TODAY"
function today()
{
var now,rv;
now = new Date();
var rv =
now.getMonth() + "/" +
now.getDate() + "/" +
now.getYear();
return rv;
}
document.write(today());
// -->
</SCRIPT>
Hi tibi38,
I'm sure you can do this in JavaScript but you don't need to.
Use a Custom Code action and add
Bob
I'm sure you can do this in JavaScript but you don't need to.
Use a Custom Code action and add
<?php
echo date('m/d/Y');
?>
Bob
Hi Bob,
tanks so much for your reply but this is my problem:
I wolud show a message that tell to users that if they make an order today their order will arrive to they next 2 days.
So I should show the date of next 2 day, for example:
today is 15/12/2011 the message should show: "you order will be delivered 17/12/2011".
So I should incrase today date of more 2 days.
To do this is better javascript or php?
How can I do this?
Regards
monak83
tanks so much for your reply but this is my problem:
I wolud show a message that tell to users that if they make an order today their order will arrive to they next 2 days.
So I should show the date of next 2 day, for example:
today is 15/12/2011 the message should show: "you order will be delivered 17/12/2011".
So I should incrase today date of more 2 days.
To do this is better javascript or php?
How can I do this?
Regards
monak83
Find:
Another question:
the delivery date should not be Saturday or Sunday because aren't a working days.
So If +2 days date is saturday I should show +4 days and if +2 days date is sunday I should show +3 days.
Some help?
Regards
Is better javascript or php?
<?php
echo date ('d/m/Y', strtotime ('+2 days'));
?>
Another question:
the delivery date should not be Saturday or Sunday because aren't a working days.
So If +2 days date is saturday I should show +4 days and if +2 days date is sunday I should show +3 days.
Some help?
Regards
Is better javascript or php?
Hi monak83,
Hmm that's a very different question . . . I guess you are going to need to write some calendar code to work out when two 'business' days ahead is.
Normally you'd do this in PHP unless you need it to depend on data input by the user - it seems as though you don't in this case.
Bob
Hmm that's a very different question . . . I guess you are going to need to write some calendar code to work out when two 'business' days ahead is.
Normally you'd do this in PHP unless you need it to depend on data input by the user - it seems as though you don't in this case.
Bob
This topic is locked and no more replies can be posted.