JSFiddle - React, Tailwind, and code Playground
HTML
<table>
<tr>
<td class="hangingIndent">
<input type="checkbox" value="true" name="chkChestAPportable" id="chkChestAPportable" />
<label for="chkChestAPportable">ED CHEST AP PORTABLE</label>
</td><td>
<select name="cboChestAPportableReason" size="1" id="cboChestAPportableReason">
<option>CHEST 1PAIN</option>
<option>SHORTNESS OF BREATH</option>
<option>COUGH</option>
<option>FEVER</option>
<option>HYPOXIA</option>
<option>VENT MANAGEMENT</option>
<option>ATELECTASIS</option>
<option>POST PROCEDURE EVAL FOR PNEUMO</option>
<option value="OTHER SEE COMMENTS">OTHER SEE COMMENTS</option>
</select>
</td><td>
<input type="text" name="txtChestAPportableComments" size="30" value="..." id="txtChestAPportableComments" />
</td>
</tr>
</table>
CSS
* { font-size: 9pt; font-family: tahoma, verdana, sans-serif; }
table { width: 100%; border-collapse: collapse; }
table th {
border-top: #cccccc 1pt solid;
border-bottom: #cccccc 1pt dotted;
padding-left: 12px;
font-weight: bold;
font-size: 10pt;
vertical-align: top;
color: #000000;
line-height: 15pt;
background-color: #eeeeee;
text-align: left;
}
table td {
padding: 2px 0 2px 12px;
vertical-align: top;
text-align: left;
}
td.hangingIndent {
text-indent: -24px;
padding-left: 36px;
}
JavaScript
/*
* clearDefaultText - jQuery Based Function to Deal with Default Text in Text / Textarea form elements
* http://heo-iforms.blogger.com/
*
* Version: 1.0
* Copyright 2012 Scott Morris - http://heo-iforms.blogger.com/
*
* Dual licensed under MIT or GPLv2 licenses
* http://en.wikipedia.org/wiki/MIT_License
* http://en.wikipedia.org/wiki/GNU_General_Public_License
*
*/
(function( $ ){
var methods = {
init : function(options) {
// Create some defaults, extending them with any options that were provided
var settings = $.extend( {
'filterBy' : 'none', // options are: {'none','class','text'}
'className' : '', // only use if 'filterBy' = 'class'
'filterText' : '...', // only use if 'filterBy' = 'text'
'findString' : 'input[type="text"]'
}, options);
var $this = $(this).find(settings.findString);
if ((settings.filterBy == 'className') && (settings.className != ''))
$this = $this.filter('.' + settings.className)
if ((settings.filterBy == 'text') && (settings.filterText != ''))
$this = $this.filter(function() { return $(this).val() == settings.filterText })
return $this.each(function() {
var $textBox = $(this)
$textBox.focus(function() {
if ($textBox.val() == $textBox.attr("defaultText"))
$textBox.val("");
});
$textBox.blur(function() {
if ($textBox.val() == "")
$textBox.val($textBox.attr("defaultText"));
});
if ($textBox.val() != '')
$textBox.attr("defaultText",$textBox.val());
});
},
destroy : function(options) {
$(window).unbind('.clearDefaultText');
}
...