Manny
07-17-2006, 12:27 PM
Hi guys,
As I'm hopeless with Javascript, I've been searching for a way to change the weekday in a text box by date selection in a drop down.
I am trying to design a timecard application where users can insert upto 10 records in the database at a time. Each row starts with date which (drop down shows the last 28 dates) - when the user selects any date from this list, I need the value in the input box next to it to change to the weekday corresponding with the date.
However, I need to keep the value of the date in the drop down too, ie, I need the date and the day as parameters for the next page, so, the following won't work:
<html>
<head></head>
<body>
<form id="myform" name="myform" method="post" action="gotonextpage.asp">
<select id="mydates" name="mydates"
onchange="document.getElementById('myday').value=this[this.selectedIndex].value">
<option value="Monday">17/07/2006</option>
<option value="Sunday">16/07/2006</option>
<option value="Saturday">15/07/2006</option>
</select><br />
<input id="myday" name="myday" type="text" value="" /><br />
<input type="submit" value="Submit" />
<input type="reset" value="Clear" />
</form>
</body>
</html>
Any help will be greatly appreciated.
Regards,
Manny
As I'm hopeless with Javascript, I've been searching for a way to change the weekday in a text box by date selection in a drop down.
I am trying to design a timecard application where users can insert upto 10 records in the database at a time. Each row starts with date which (drop down shows the last 28 dates) - when the user selects any date from this list, I need the value in the input box next to it to change to the weekday corresponding with the date.
However, I need to keep the value of the date in the drop down too, ie, I need the date and the day as parameters for the next page, so, the following won't work:
<html>
<head></head>
<body>
<form id="myform" name="myform" method="post" action="gotonextpage.asp">
<select id="mydates" name="mydates"
onchange="document.getElementById('myday').value=this[this.selectedIndex].value">
<option value="Monday">17/07/2006</option>
<option value="Sunday">16/07/2006</option>
<option value="Saturday">15/07/2006</option>
</select><br />
<input id="myday" name="myday" type="text" value="" /><br />
<input type="submit" value="Submit" />
<input type="reset" value="Clear" />
</form>
</body>
</html>
Any help will be greatly appreciated.
Regards,
Manny