...

View Full Version : Filling up textarea



cptn_future
10-22-2003, 03:02 AM
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

Caffeine
10-22-2003, 07:25 AM
Replace them <br>'s with \n instead and you will get linebreaks! :)



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum