Hi Experts,
I'm writing an admin page for a site and this particular bit allows an admin to set the text that will be displayed when the system is down. It comes in two flavors, one for taking it down immediately and the other to give a warning and then take it down. The default message is to take it down immediately.
I've got two radio buttons to allow selecting one or the other and some javascript that should enable and disablethe textarea message text. When the page loads it defaults to the default message but clicking on the other radio button doesn't seem to run the javascript to enable the other textarea.
Thanks for any insight.
Peter
<fieldset><legend>Take the site up or down</legend><hr>
<form method="post" action="admin_site_availability.asp" name="site_availability_form">
<table width="100%">
<tr>
<td width="10%"><input type="radio" name="rbMsgSource" value="useDefault" checked onclick="enableDefault()"></td>
<td width="90%">Use this default message when you are taking the system down immediately.</td>
</tr>
<tr>
<td></td>
<td><textarea name="txtDefaultMessage" rows="5" cols="35"><%= msgAvailabilityDefault %></textarea></td>
</tr>
</table><hr>
<table width="100%"
<tr>
<td width="10%"><input type="radio" name="rbMsgSource" value="useCustom" onclick="enableCustom()"></td>
<td width="90%">Use this warning message and announcement message when you want to schedule a maintenance window. Remember you must still take the system down at the proper time, and also bring it back up.</td>
</tr>
<tr>
<td width="10%"></td>
<td><textarea name="txtCustomWarning" rows="5" cols="35" disabled="true"><%= msgAvailabilityWarning %></textarea></td>
</tr>
<tr>
<td width="10%"></td>
<td><textarea name="txtCustomMessage" rows="5" cols="35" disabled="true"><%= msgAvailabilityCustom %></textarea></td>
</tr>
<tr>
<td><input type="submit" value="Submit"></td>
</tr>
</table>
</form>
</fieldset>
<script type="text/javascript">
function enableDefault() {
document.site_availability_form.txtDefaultMessage.disabled=false;
document.site_availability_form.txtCustomWarning.disabled=true;
document.site_availability_form.txtCustomMessage.disabled=true;
}
function enableCustom() {
document.site_availability_form.txtDefaulMessage.disabled=true;
document.site_availability_form.txtCustomWarning.disabled=false;
document.site_availability_form.txtCustomMessage.disabled=false;
}
</script>
function enableCustom() {
///t here
document.site_availability
document.site_availability
document.site_availability
}