showing variable in <caption> tag
by pizzipie from LinuxQuestions.org on (#5M1PN)
The following is html5 for a table. How do you get a Javascript Variable, in this case, patientto show up inside the caption?
Code:<table class='allTbl center' border='3' cellpadding='5' bgcolor='#feeed4' >
================================
<caption> Edit Patient Data For <span style='color:yellow; background:#055584'>+patient+"</span></caption>
================================
<tr><th><td id="form" ><form hidden='hidden' id='contactForm'></td></th></tr>
<tr><th scope='row'>Id</th><td class='dat disp' ><input disabled='disabled' type='text' name='id' id='id'></td></tr>
<tr><th scope='row'>Patient</th><td class='dat'><input type='text' name='patient' id='patient'> </td></tr>
<tr><th scope='row'>Doctor</th><td class='dat'><input type='text' name='doctor' id='doctor' ></td></tr>
<tr><th scope='row'>Pharmacy</th><td class='dat'><input type='text' name='pharmacy' id='pharmacy'></td></tr>
<tr><th scope='row'>Date</th><td class='dat'><input type='text' name='date' id='date'></td></tr>
<tr><th scope='row'>Place</th><td class='dat'><input type='text' name='place' id='place'></td></tr>
<tr><th scope='row'>Tests</th><td colspan="3" class='dat'><textarea name='tests' id='tests' rows="3" cols="40"></textarea></tr>
<tr><th scope='row'>Results</th><td colspan="3" class='dat'><textarea name='results' id='results' rows="3" cols="40"></textarea></td></tr>
<tr><th scope='row'>Notes</th><td colspan="3" class='dat'><textarea name='notes' id='notes' rows="3" cols="40"></textarea></td></tr>
<tr><th><td></form></td></th></tr>
</table>I've tried encapsulating the <span> tags with <script> tags but that doesn't work either.
Thanks in advance for help.
R


Code:<table class='allTbl center' border='3' cellpadding='5' bgcolor='#feeed4' >
================================
<caption> Edit Patient Data For <span style='color:yellow; background:#055584'>+patient+"</span></caption>
================================
<tr><th><td id="form" ><form hidden='hidden' id='contactForm'></td></th></tr>
<tr><th scope='row'>Id</th><td class='dat disp' ><input disabled='disabled' type='text' name='id' id='id'></td></tr>
<tr><th scope='row'>Patient</th><td class='dat'><input type='text' name='patient' id='patient'> </td></tr>
<tr><th scope='row'>Doctor</th><td class='dat'><input type='text' name='doctor' id='doctor' ></td></tr>
<tr><th scope='row'>Pharmacy</th><td class='dat'><input type='text' name='pharmacy' id='pharmacy'></td></tr>
<tr><th scope='row'>Date</th><td class='dat'><input type='text' name='date' id='date'></td></tr>
<tr><th scope='row'>Place</th><td class='dat'><input type='text' name='place' id='place'></td></tr>
<tr><th scope='row'>Tests</th><td colspan="3" class='dat'><textarea name='tests' id='tests' rows="3" cols="40"></textarea></tr>
<tr><th scope='row'>Results</th><td colspan="3" class='dat'><textarea name='results' id='results' rows="3" cols="40"></textarea></td></tr>
<tr><th scope='row'>Notes</th><td colspan="3" class='dat'><textarea name='notes' id='notes' rows="3" cols="40"></textarea></td></tr>
<tr><th><td></form></td></th></tr>
</table>I've tried encapsulating the <span> tags with <script> tags but that doesn't work either.
Thanks in advance for help.
R