ericaalicen
Programmer
I need to take a starting date entered in a form field and add 7 days and display that in the form field for an ending date. I'm not especially javascript savvy. I've put together a script from a number of different things I've found on line, but the ending date always appears as 0.
<script>
function add(theForm) {
var start = form.start.value;
if (!isNaN(start)) {
var x = setDate(start.getDate() + 7);
form.end.value = x;
}
}
</script>
<form name="form" method="post" action="avail.cfm?add=1">
Start: <input type="text" name="start" size="10 onKeyUp="add(this.form)">
End: <input type="text" name="end" size="10">
Price: <input type="text" name="price" size="10">
<input type="submit" value="Add"> </form>
Any help is appreciated.
<script>
function add(theForm) {
var start = form.start.value;
if (!isNaN(start)) {
var x = setDate(start.getDate() + 7);
form.end.value = x;
}
}
</script>
<form name="form" method="post" action="avail.cfm?add=1">
Start: <input type="text" name="start" size="10 onKeyUp="add(this.form)">
End: <input type="text" name="end" size="10">
Price: <input type="text" name="price" size="10">
<input type="submit" value="Add"> </form>
Any help is appreciated.