Jump to content

Deleteing values in text area doesnt allow new ones to be inputted


Recommended Posts

Hi all, I have a drop down selector which populates a textarea, When I delete everything in my text area and then try and repopuplate it doesnt work however, Can anybody take a look at my code and have a guess why? Thanks

 

          <td valign="top" class="KT_th"><label for="workconsidered_1">What work will you consider?</label></td>
          <td>     <select name="country" id="selbox" onchange="htmlData(this.value,'workconsidered')" />
   <option value="">Available Options</option>
<option value="Portrait, ">Portrait</option>
<option value="Catwalk, ">Catwalk</option>
<option value="Glamour, ">Glamour</option>
<option value="Implied Topless, ">Implied Topless</option>
<option value="Implied Nude, ">Implied Nude</option>
<option value="Glamour Topless, ">Glamour Topless</option>
<option value="Glamour Nude, ">Glamour Nude</option>
<option value="Promotions, ">Promotions</option>
<option value="Other">Other</option>
</select> <br />
<textarea name="workconsidered" cols="50" rows="5" id="workconsidered" ><?php echo $row_rs_model_biographies_['workconsidered']; ?></textarea>

 

My JS is

<script type="text/javascript">

function htmlData(selectValue,targetTextArea)
{
//   alert("select box changed to : '" + selectValue + "'");

   var txtNode=document.createTextNode(selectValue);
   var textArea=document.getElementById(targetTextArea);
   textArea.appendChild(txtNode);
}
</script>

Just an observation. But, is there some reason you feel you need a complex function such as this for the user to select multiple values instead of just giving the user a list of multiple checkboxes? Seems a much more user-friendly, intuitive solution to me.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.