I've looked everywhere for the answer to this and can't find it. Is
it possible to automatically fill in the value of a field in a form
once a value is entered in another field?
For example, I want to have the same date entered in "Start Date" pop
up into "End Date" automatically with the option of letting the user
change it if needed.
TIA!
Here's my code:
<table width="90%" border="0">
<tr>
<td width="18%" height="25" class="pgtext"><div
align="right" class="pgtext"><strong>Event:</strong></div></td>
<td colspan="4"> <span class="pgtext">
<input name="txtEvent" type="text" id="txtEvent2"
size="50" maxlength="70">
</span></td>
</tr>
<tr>
<td class="pgtext"><div align="right"
class="pgtext"><strong>Start Date:</strong></div></td>
<td width="14%"> <span class="pgtext">
<input name="varStartDate" type="text" id="varStartDate"
onBlur="MM_validateForm('txtEvent2','','R','varSta rtDate','','R');return
document.MM_returnValue" size="10" maxlength="10">
</span></td>
<td width="16%"><span class="pgtext">
<input name="StartDateCal" type="button"
id="StartDateCal" onClick="KW_doCalendar('txtStartDate',0)"
value="Calendar">
</span></td>
<td width="26%" class="pgtext"> <div align="right"
class="pgtext"><strong>Start
Time:</strong></div></td>
<td width="26%"> <span class="pgtext">
<input name="txtStartTime" type="text"
id="txtStartTime2" size="10" maxlength="10">
</span></td>
</tr>
<tr>
<td class="pgtext"><div align="right"
class="pgtext"><strong>End Date:</strong></div></td>
<td colspan="2"> <span class="pgtext">
<input name="txtEndDate" type="text" id="txtEndDate"
size="10" maxlength="10">
<input name="EndDateCalendar" type="button"
id="EndDateCalendar" onClick="KW_doCalendar('txtEndDate',0)"
value="Calendar">
<strong> </strong></span></td>
<td class="pgtext"> <div align="right"
class="pgtext"><strong>End Time:</strong></div></td>
<td> <span class="pgtext">
<input name="txtEndTime" type="text" id="txtEndTime2"
size="10" maxlength="10">
</span></td>
</tr>
<tr>
<td class="pgtext"><div align="right"
class="pgtext"><strong>Location:</strong></div></td>
<td colspan="4"> <span class="pgtext">
<select name="txtLocation" id="select2">
<option value="Location" <%If (Not
isNull((rs_location.Fields.Item("location").Value) )) Then If
("Location" = CStr((rs_location.Fields.Item("location").Value))) Then
Response.Write("SELECTED") : Response.Write("")%>>Location</option>
<%
While (NOT rs_location.EOF)
%>
<option
value="<%=(rs_location.Fields.Item("location").Val ue)%>" <%If (Not
isNull((rs_location.Fields.Item("location").Value) )) Then If
(CStr(rs_location.Fields.Item("location").Value) =
CStr((rs_location.Fields.Item("location").Value))) Then
Response.Write("SELECTED") : Response.Write("")%>
Quote:
%=(rs_location.Fields.Item("location").Value)%></option |
<%
rs_location.MoveNext()
Wend
If (rs_location.CursorType > 0) Then
rs_location.MoveFirst
Else
rs_location.Requery
End If
%>
</select>
</span></td>
</tr>
<tr>
<td class="pgtext"><div align="right"
class="pgtext"><strong>Group:</strong></div></td>
<td colspan="4"> <span class="pgtext">
<select name="txtGroup" id="txtGroup">
<option value="All" <%If (Not
isNull((rs_group.Fields.Item("evt_grp").Value))) Then If ("All" =
CStr((rs_group.Fields.Item("evt_grp").Value))) Then
Response.Write("SELECTED") : Response.Write("")%>>All</option>
<%
While (NOT rs_group.EOF)
%>
<option
value="<%=(rs_group.Fields.Item("evt_grp").Value)% >" <%If (Not
isNull((rs_group.Fields.Item("evt_grp").Value))) Then If
(CStr(rs_group.Fields.Item("evt_grp").Value) =
CStr((rs_group.Fields.Item("evt_grp").Value))) Then
Response.Write("SELECTED") : Response.Write("")%>
Quote:
%=(rs_group.Fields.Item("evt_grp").Value)%></option |
<%
rs_group.MoveNext()
Wend
If (rs_group.CursorType > 0) Then
rs_group.MoveFirst
Else
rs_group.Requery
End If
%>
</select>
</span></td>
</tr>
<tr>
<td class="pgtext"><div align="right"
class="pgtext"><strong>Who can attend?</strong></div></td>
<td colspan="4"> <span class="pgtext">
<input name="txtAttend" type="text" id="txtAttend2"
size="30" maxlength="30">
</span></td>
</tr>
<tr>
<td class="pgtext"><div align="right"
class="pgtext"><strong>Type:</strong></div></td>
<td colspan="4" class="pgtext">
<select name="txtType" id="select3">
<option value="Location" <%If (Not
isNull((rs_types.Fields.Item("type").Value))) Then If ("Location" =
CStr((rs_types.Fields.Item("type").Value))) Then
Response.Write("SELECTED") : Response.Write("")%>>Location</option>
<%
While (NOT rs_types.EOF)
%>
<option
value="<%=(rs_types.Fields.Item("type").Value)%>" <%If (Not
isNull((rs_types.Fields.Item("type").Value))) Then If
(CStr(rs_types.Fields.Item("type").Value) =
CStr((rs_types.Fields.Item("type").Value))) Then
Response.Write("SELECTED") : Response.Write("")%>
Quote:
%=(rs_types.Fields.Item("type").Value)%></option |
<%
rs_types.MoveNext()
Wend
If (rs_types.CursorType > 0) Then
rs_types.MoveFirst
Else
rs_types.Requery
End If
%>
</select>
</td>
</tr>
<tr>
<td class="pgtext"><div align="right"
class="pgtext"><strong>Contact:</strong></div></td>
<td colspan="4"> <span class="pgtext">
<input name="txtContact" type="text" id="txtContact2"
size="30" maxlength="50">
</span></td>
</tr>
<tr>
<td valign="top" class="pgtext"><div align="right"
class="pgtext"><strong>Description:</strong></div></td>
<td colspan="4" class="pgtext">
<textarea name="txtDesc" cols="45" rows="4"
id="txtDesc"></textarea>
</td>
</tr>
<tr>
<td colspan="5"> </td>
</tr>
</table>