Hello I am using coldfusion to create a field that will allow one to pick a date from a calendar.
However, on this form, I am going to have fields for two dates, so, it would be nice if, after a person entered a value for one field, automatically this value got entered into another field..
This is what the test page looks like...
I was wondering if I could use javascript somehow to insert a value into the Date field 2 that matched the value selected in Date 1?
I am attaching the code that is one the page...the initial value portion of Date 2:
initialvalue="#DateFormat(now(),"mm/dd/yy"#"
is what I need to populate based on the selection from Date 1
I guess the answer that I am looking for is how can I insert a variable whose value is dependent on what is picked in Date1 into the value for Date 2...
I look forward to your insight! I am enclosing the code for the test page below..
<head>
<title>Adding A Calendar Event</title>
<link href="../Includes/styles.css" rel="stylesheet" type="text/css">
</head>
<body>
<table>
<tr>
<td width="150">
<form action="test.cfm" name="frm1" id="frm1">
<div align="center">Date 1</div>
<br>
<cf_datepicker textboxname="txtcolor1"
formname="frm1"
image="Images/PickDate.gif"
font="arial"
fontcolor="gray"
dayheadercolor="990000"
monthcolor="EAC6BF"
othermonthscolor="white"
backcolor="EFEFEF"
first_use_on_page="yes"
dateorder="mm/dd/yy"
language="english"
hidedivname="div1"
displayorientation="right">
</td>
<td width="150">
<div align="center">Date 2</div>
<br>
<cf_datepicker textboxname="txtcolor2"
formname="frm1"
image="Images/PickDate.gif"
font="arial"
fontcolor="gray"
dayheadercolor="990000"
monthcolor="EAC6BF"
othermonthscolor="white"
backcolor="EFEFEF"
dateorder="mm/dd/yy"
initialvalue="#DateFormat(now(),"mm/dd/yy"#"
language="english"
hidedivname="div1"
displayorientation="right">
</td>
</tr>
<tr>
<td colspan="2">
<div id="div1" style="position: relative; top: 0px; left: 0px; visibility: show;">
test
</div>
</td>
</tr>
</form>
</table>
However, on this form, I am going to have fields for two dates, so, it would be nice if, after a person entered a value for one field, automatically this value got entered into another field..
This is what the test page looks like...
I was wondering if I could use javascript somehow to insert a value into the Date field 2 that matched the value selected in Date 1?
I am attaching the code that is one the page...the initial value portion of Date 2:
initialvalue="#DateFormat(now(),"mm/dd/yy"#"
is what I need to populate based on the selection from Date 1
I guess the answer that I am looking for is how can I insert a variable whose value is dependent on what is picked in Date1 into the value for Date 2...
I look forward to your insight! I am enclosing the code for the test page below..
<head>
<title>Adding A Calendar Event</title>
<link href="../Includes/styles.css" rel="stylesheet" type="text/css">
</head>
<body>
<table>
<tr>
<td width="150">
<form action="test.cfm" name="frm1" id="frm1">
<div align="center">Date 1</div>
<br>
<cf_datepicker textboxname="txtcolor1"
formname="frm1"
image="Images/PickDate.gif"
font="arial"
fontcolor="gray"
dayheadercolor="990000"
monthcolor="EAC6BF"
othermonthscolor="white"
backcolor="EFEFEF"
first_use_on_page="yes"
dateorder="mm/dd/yy"
language="english"
hidedivname="div1"
displayorientation="right">
</td>
<td width="150">
<div align="center">Date 2</div>
<br>
<cf_datepicker textboxname="txtcolor2"
formname="frm1"
image="Images/PickDate.gif"
font="arial"
fontcolor="gray"
dayheadercolor="990000"
monthcolor="EAC6BF"
othermonthscolor="white"
backcolor="EFEFEF"
dateorder="mm/dd/yy"
initialvalue="#DateFormat(now(),"mm/dd/yy"#"
language="english"
hidedivname="div1"
displayorientation="right">
</td>
</tr>
<tr>
<td colspan="2">
<div id="div1" style="position: relative; top: 0px; left: 0px; visibility: show;">
test
</div>
</td>
</tr>
</form>
</table>