hey i am new to jquery and i have a form where the data is in the form of radio buttons and check boxes at end there is a textarea to show the selected form values. I need to show the selected form variables in the textarea without repetition. I need help regarding this issue.
My form looks like this:
<form name="chestpain" method="post" action="insert_chestpain.php">
<div style="font-family: TimesNewRoman; font-size:18px;">
<div style="padding: 10px;">
When did the pain start?<br/>
<input type="radio" name="onset" value="Less than 1day" checked onclick="writeResult(' Started ','Less than 1day',' back');"/>Less than 1 day
<input type="radio" name="onset" value="2 to 4 days" onclick="writeResult(' Started ','2 to 4 days',' back');"/>2 to 4 days
<input type="radio" name="onset" value="4 to 7 days" onclick="writeResult(' Started ','4 to 7 days',' back');"/>4 to 7 days<br/>
<input type="radio" name="onset" value="1 to 2 weeks" onclick="writeResult(' Started ','1 to 2 weeks',' back');"/>1 to 2 weeks
<input type="radio" name="onset" value="more than 2 weeks" onclick="writeResult(' Started ','more than 2 weeks',' back');" />more than 2 weeks<br/>
</div>
<div style="padding: 10px;">
How long does the each episode of pain last?<br/>
<input type="radio" name="duration" value="Less than 5 minutes" onclick="writeResult('Pain lasts ','Less than 5 minutes','');"/>Less than 5 minutes
<input type="radio" name="duration" value="5 to 30 minutes"
onclick="writeResult('Pain lasts upto:','5 to 30 minutes','');"/>5 to 30 minutes<br/>
<input type="radio" name="duration" value="1 to 2 Hours" onclick="writeResult('Pain lasts ','1 to 2 hours','');"/>1 to 2 hours
<input type="radio" name="duration" value="morethan 2 hours" onclick="writeResult('Pain lasts ','more than 2 hours','');"/>more than 2 hours<br/>
<input type="radio" name="duration" value="1 to 2 days" onclick="writeResult('Pain lasts ','1 to 2 days','');"/>1 to 2 days
<input type="radio" name="duration" value="2 to 5 days" onclick="writeResult('Pain lasts ','2 to 5 days','');"/>2 to 5 days
<input type="radio" name="duration" value="morethan 5 days" onclick="writeResult('Pain lasts ','more than 5 days','');"/>more than 5 days<br/>
</div>
<div style="padding: 10px;">
How often is the pain?<br/>
<input type="radio" name="frequency" value="One time event" onclick="writeResult('pain is a','One time event','');"/>One time event
<input type="radio" name="frequency" value="Continuous (most of the time)" onclick="writeResult('pain will be ','Continuous (most of the time)','');"/>Continuous (most of the time)
<input type="radio" name="frequency" value="1 to 2 times a day" onclick="writeResult('pain comes','1 to 2 times a day','');"/>1 to 2 times a day
<input type="radio" name="frequency" value=" more than 5 times a day" onclick="writeResult('pain comes','more than 5 times a day','');"/>more than 5 times a day
</div>
<div style="padding: 10px;">
Where do you feel the pain?<br/>
<input type="radio" name="location" value="Entire chest" onclick="writeResult('Pain is on ','Entire chest','');"/>Entire chest
<input type="radio" name="location" value="Mid-chest/Retrosternal"onclick="writeResult('Pain is on ','Mid-chest/Retrosternal','');"/>Mid-chest/Retrosternal
<input type="radio" name="location" value="Left side of chest"onclick="writeResult('Pain is on ','Left side of chest','');"/>Left side of chest
<input type="radio" name="location" value="Right side of chest"onclick="writeResult('Pain is on','Right side of chest','');"/>Right side of chest
<input type="radio" name="location" value="Lower chest (Left side)"onclick="writeResult('Pain is at','Lower chest (Left side)','');"/>Lower chest (Left side)
<input type="radio" name="location" value="Single rib-cage level" onclick="writeResult('Pain is at','Single rib-cage level','');"/>Single rib-cage level
</div>
<div style="padding: 10px;">
Does the pain spread to any other area? If yes, specify the area?<br/>
<input type="checkbox" name="radiation[]" value="No" onclick="writeResult('','NO','it doesnot spread to anyarea');" />No
<input type="checkbox" name="radiation[]" value="Neck/Jaw" onclick="writeResult('Spreads to my ','Neck/Jaw',' area');"/>Neck/Jaw
<input type="checkbox" name="radiation[]" value="Left Arm/Shoulder" onclick="writeResult('Spreads to my ','Left Arm/Shoulder',' area');"/><b>Left Arm/Shoulder</b>
<input type="checkbox" name="radiation[]" value="Right Shoulder" onclick="writeResult('Spreads to my ','Right Shoulder',' area');"/>Right Shoulder
<input type="checkbox" name="radiation[]" value="Upper Back" onclick="writeResult('Spreads to my ','Upper Backl',' area');"/>Upper Back
<input type="checkbox" name="radiation[]" value="Back to front of chest" onclick="writeResult('Spreads to my ','Back to front of chest',' area');"/>Back to front of chest
</div>
<div style="padding: 10px;">
how does the pain feel?<br/>
<input type="radio" name="quality" value="Squeezing" onclick="writeResult('Pain is ','Squeezing',' in character');"/>Squeezing
<input type="radio" name="quality" value="Choking" onclick="writeResult('Pain is ','Choking','');"/>Choking
<input type="radio" name="quality" value="Burning" onclick="writeResult('Pain is ','Burning','');"/>Burning
<input type="radio" name="quality" value="Stabbing" onclick="writeResult('Pain is ','Stabbing','');"/>Stabbing
<input type="radio" name="quality" value="Tearing" onclick="writeResult('Pain is ','Tearing','');"/>Tearing
<input type="radio" name="quality" value="Sharp pricking" onclick="writeResult('Pain is ','Sharp pricking',' ');"/>Sharp pricking
<input type="radio" name="quality" value="Tingling (like shock)" onclick="writeResult('Pain is ','Tingling (like shock)','');"/>Tingling (like shock)
<input type="radio" name="quality" value="Heavy Pressure" onclick="writeResult('Pain is ','Heavy Pressure','');"/>Heavy Pressure
</div>
<div style="padding: 10px;">
What is your pain scale??<br/>
<input type="radio" name="severity" value="Mild (pick 1, 2 or 3)" onclick="writeResult('','Mild','');"/>Mild (pick 1, 2 or 3)
<input type="radio" name="severity" value="Moderate (pick 4, 5, 6 or 7)" onclick="writeResult('','Moderate','');"/>Moderate (pick 4, 5, 6 or 7)
<input type="radio" name="severity" value="Severe (pick 8, 9 or 10)" onclick="writeResult('','Severe','');"/>Severe (pick 8, 9 or 10)<br/>
</div>
<div style="padding: 10px;">
Is the pain increasing, decreasing or the same in intensity?<br/>
<input type="radio" name="intensity" value="Increasing" onclick="writeResult('','Increasing','');"/>Increasing
<input type="radio" name="intensity" value="Decreasing" onclick="writeResult('','Decreasing','');"/>Decreasing
<input type="radio" name="intensity" value="Constant(stable)" onclick="writeResult('','Constant(stable)','');"/>Constant(stable)<br/>
</div>
<div style="padding: 10px;">
What relieves the pain?/what makes pain better?<br/>
<input type="checkbox" name="alleviation[]" value="No Relief" onclick="writeResult('','No Relief','');"/>No Relief
<input type="checkbox" name="alleviation[]" value="Relieved by Rest" onclick="writeResult('','Relieved by Rest','');"/>Relieved by Rest
<input type="checkbox" name="alleviation[]" value="Relieved by Food" onclick="writeResult('','Relieved by Food','');"/>Relieved by Food
<input type="checkbox" name="alleviation[]" value="Relieved by Swallowing" onclick="writeResult('','Relieved by Swallowing','');"/>Relieved by Swallowing<br/>
<input type="checkbox" name="alleviation[]" value="Relieved by Applying local pressure" onclick="writeResult('','Relieved by Applying local pressure','');"/>Relieved by Applying local pressure
<input type="checkbox" name="alleviation[]" value="Relived by Sleeping" onclick="writeResult('','Relived by Sleeping','');"/>Relieved by Sleeping
<input type="checkbox" name="alleviation[]" value="Relieved by Antacids" onclick="writeResult('','Relieved by Antacids','');"/>Relieved by Antacids
<input type="checkbox" name="alleviation[]" value="Relived by Local Pressure" onclick="writeResult('','Relived by Local Pressure','');"/>Relieved by Local Pressure
</div>
<div style="padding: 10px;">
What makes the pain worse?<br/>
<input type="checkbox" name="aggravation[]" value="Activity / Exercise" onclick="writeResult('','Activity / Exercise','');"/>Activity / Exercise
<input type="checkbox" name="aggravation[]" value="Movement of Neck" onclick="writeResult('','Movement of Neck','');"/>Movement of Neck
<input type="checkbox" name="aggravation[]" value="Bending forward" onclick="writeResult('','Bending forward','');"/>Bending forward
<input type="checkbox" name="aggravation[]" value="Lying Down" onclick="writeResult('','Lying Down','');"/>Lying Down
<input type="checkbox" name="aggravation[]" value="Food" onclick="writeResult('','Food','');"/>Food
<input type="checkbox" name="aggravation[]" value="Coughing" onclick="writeResult('','Coughing','');"/>Coughing
<input type="checkbox" name="aggravation[]" value="Sneezing" onclick="writeResult('','Sneezing','');"/>Sneezing
<input type="checkbox" name="aggravation[]" value="Deep breathing" onclick="writeResult('','Deep breathing','');"/>Deep breathing
</div>
<div style="padding: 10px;">
What is the pain accompained with?<br/>
<input type="checkbox" name="association[]" value="Tingling / Numbness in same area" onclick="writeResult('','Tingling / Numbness in same area','');"/>Tingling / Numbness in same area
<input type="checkbox" name="association[]" value="Sweating" onclick="writeResult('','Sweating','');"/>Sweating
<input type="checkbox" name="association[]" value="Difficulty breathing / Wheezing" onclick="writeResult('','Difficulty breathing / Wheezing','');"/>Difficulty breathing / Wheezing<br/>
<input type="checkbox" name="association[]" value="Food" onclick="writeResult('','Food','');"/>Food
<input type="checkbox" name="association[]" value="Dizziness" onclick="writeResult('','Dizziness','');"/>Dizziness
<input type="checkbox" name="association[]" value="Nausea or Queasiness" onclick="writeResult('','Nausea or Queasiness','');"/>Nausea or Queasiness
<input type="checkbox" name="association[]" value="Vomiting" onclick="writeResult('','Vomiting','');"/>Vomiting
<input type="checkbox" name="association[]" value="Abdominal Pain" onclick="writeResult('','Abdominal Pain','');"/>Abdominal Pain
<input type="checkbox" name="association[]" value="Fever" onclick="writeResult('','Fever','');"/>Fever
<input type="checkbox" name="association[]" value="Cough" onclick="writeResult('','Cough','');"/>Cough
<input type="checkbox" name="association[]" value="Blood in sputum" onclick="writeResult('','Blood in sputum','');"/>Blood in sputum<br/>
<input type="checkbox" name="association[]" value="Hoarse voice" onclick="writeResult('','Hoarse voice','');"/>Hoarse voice
<input type="checkbox" name="association[]" value="Weight Gain" onclick="writeResult('','Weight Gain','');"/>Weight Gain
<input type="checkbox" name="association[]" value="Passing out" onclick="writeResult('','Passing out','');"/>Passing out
<input type="checkbox" name="association[]" value="Feeling your heart beat rapidly" onclick="writeResult('','Feeling your heartbeat rapidly','');"/>Feeling your heart beat rapidly
<input type="checkbox" name="association[]" value="Get up at night to urinate" onclick="writeResult('','Getup at night to urinate','');"/>Getup at night to urinate
<input type="checkbox" name="association[]" value="Trauma" onclick="writeResult('','Trauma','');"/>Trauma<br/>
</div>
<input type="submit" name="submit" value="submit" />
</div>
<textarea name="getvalues" id="textresultdescription" rows="4" cols="100"></textarea>
</form>
Thank s in advance
Ramsai