Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New Coder
    Join Date
    Oct 2003
    Posts
    12
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Post Filling up textarea

    Hi all...
    Im trying to fill up a text area with some text. The problem im facing is, that I want carriage returns in this text area to show. I've implemented the code below.

    <!--------------------------------------
    <textarea name="txtChart" cols="60" rows="7"></textarea>
    </td>
    <td><select name="example" size="1" onChange="showtext()">
    <option value="Tonsilitis">Tonsilitis</option>
    <option value="Flue">Flue</option>
    <option value="SARS">SARS</option>
    </select></td>
    <script language="javascript">
    <!--

    /*
    Combo box with description credit-
    By JavaScript Kit (www.javascriptkit.com)
    Over 200+ free script here!
    */

    var shortcut=document.combowithtext
    var descriptions=new Array()

    //extend this list if neccessary to accomodate more selections
    descriptions[0]="SUBJECTIVE: no cough, no runny nose, sore throat, fever, no tearing, no shortness of breath, no muscle aching, ear aching, headache. OBJECTIVE: Good general condition, chest is clear and good air entry, heart is S1,S2, no murmer, abdomen soft, ear left and right normal. Throat congested with white exudates, temp 38.5 no neck stiffiness or kering sign. No cervical lymphnode. ASSESSMENT: CBC, monospot, throat swap. PLAN: 1- Antibiotic2- 2 F/U if not feeling better"
    descriptions[1]="SUBJECTIVE: Marry has a little lamb, no runny nose, sore throat, Went and played in the fields, no shortness of breath, no muscle aching, ear aching, headache.<br> OBJECTIVE: Good general condition, chest is clear and good air entry, heart is S1,S2, no murmer, abdomen soft, ear left and right normal. Throat congested with white exudates, temp 38.5 no neck stiffiness or kering sign. No cervical lymphnode.<br> ASSESSMENT: CBC, monospot, throat swap. <br> PLAN: 1- Antibiotic2- 2 F/U if not feeling better"
    descriptions[2]="Click here for Geocities, and receive 10 megs of free web space."


    shortcut.txtChart.value=descriptions[shortcut.example.selectedIndex]
    function showtext(){
    shortcut.txtChart.value=descriptions[shortcut.example.selectedIndex]
    }
    //-->
    </script>
    <!------------------------------------------------------------------
    as you an see... I've included <br> inside the arry text to no avail.. anyone got any idea??

    Your reply is much appriciated

    Curt

  • #2
    Regular Coder
    Join Date
    Mar 2003
    Posts
    241
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Replace them <br>'s with \n instead and you will get linebreaks!


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •