J
Jes
Hi
First, thanks to all for the help as I am new to JAVASCRIPT. I only
need to solve one last problem.
<td class="Input"><input id="BOOKINGDATE" name="BOOKINGDATE"
value="@BOOKINGDATE@"> </td>
this is the field in table mysql
now I want to split in Day,Month,Year
<form name="form1" id="form1">
<td class="Input"><select name="BKDAY" id="BKDAY"> --- select option
from 1 to 31
<td class="Input"><select name="BKMONTH" id="BKMONTH"> --- select
option from 1 to 31
<td class="Input"><input name="BKYEAR" id="BKYEAR">
</form>
<script>
today = new Date();
document.form1.BKDAY.selectedIndex = today.getDate() - 1;
document.form1.BKMONTH.selectedIndex = today.getMonth();
document.form1.BKYEAR.value = today.getYear();
</script>
Value in BKYEAR is correct with today's year and the right options are
selected in BKDAY and BKMONTH.
However, I want to have the values that I have in the field
BOOKINGDATE and not of today.
I am trying
today = new Date(document.form1.BOOKINGDATE.value)
but it is not working.
Why please ?
Regards
Jesmond
First, thanks to all for the help as I am new to JAVASCRIPT. I only
need to solve one last problem.
<td class="Input"><input id="BOOKINGDATE" name="BOOKINGDATE"
value="@BOOKINGDATE@"> </td>
this is the field in table mysql
now I want to split in Day,Month,Year
<form name="form1" id="form1">
<td class="Input"><select name="BKDAY" id="BKDAY"> --- select option
from 1 to 31
<td class="Input"><select name="BKMONTH" id="BKMONTH"> --- select
option from 1 to 31
<td class="Input"><input name="BKYEAR" id="BKYEAR">
</form>
<script>
today = new Date();
document.form1.BKDAY.selectedIndex = today.getDate() - 1;
document.form1.BKMONTH.selectedIndex = today.getMonth();
document.form1.BKYEAR.value = today.getYear();
</script>
Value in BKYEAR is correct with today's year and the right options are
selected in BKDAY and BKMONTH.
However, I want to have the values that I have in the field
BOOKINGDATE and not of today.
I am trying
today = new Date(document.form1.BOOKINGDATE.value)
but it is not working.
Why please ?
Regards
Jesmond