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>

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.