troubleshooting Question

Enabling and disabling text input onclicking a radio button

Avatar of padmasambhava
padmasambhava asked on
7 Comments1 Solution287 ViewsLast Modified:
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.

<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%">
    <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>
    <td><textarea name="txtDefaultMessage" rows="5" cols="35"><%= msgAvailabilityDefault %></textarea></td>

<table width="100%"
      <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>
      <td width="10%"></td>
      <td><textarea name="txtCustomWarning" rows="5" cols="35" disabled="true"><%= msgAvailabilityWarning %></textarea></td>
      <td width="10%"></td>
      <td><textarea name="txtCustomMessage" rows="5" cols="35" disabled="true"><%= msgAvailabilityCustom %></textarea></td>
    <td><input type="submit" value="Submit"></td>

<script type="text/javascript">
function enableDefault() {
function enableCustom() {

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Log in to continue reading
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform for $9.99/mo
View membership options
Unlock 1 Answer and 7 Comments.
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
See how we're fighting big data
The Value of Experts Exchange in My Daily IT Life

Experts Exchange (EE) has become my company's go-to resource to get answers. I've used EE to make decisions, solve problems and even save customers. OutagesIO has been a challenging project and... Keep reading >>


Owner of Outages.IO
Phoenix, Arizona, United States
Member Since 2016
Join a full scale community that combines the best parts of other tools into one platform.
Unlock 1 Answer and 7 Comments.
View membership options
“All of life is about relationships, and EE has made a virtual community a real community. It lifts everyone's boat.”
William Peck

Member since 2004