Here is your script altered so that the function works with more than field
HTML Code:
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>
<body>
<script type="text/javascript">
var textbox = function(me,field){
if(me.checked == false){
var textb = document.createElement('input');
textb.type = "text";
textb.name = field;
me.parentNode.appendChild(textb);
}
setInterval(function(){
if(me.checked == false){
me.parentNode.removeChild(textb);
return false;
}
}, 50);
};
</script>
<form action="form2.php" method="post">
<table>
<tr bgcolor="#e8e8e8">
<TD WIDTH="36%" class="main">
:Punctuation after “objection”
</TD>
<TD WIDTH="64%" class="main" valign="top">
<input name="Objection" type="radio" value="3"<? print($pref_info['Objection'] == '3')? " checked" : ""; ?> Objection. Vague, asumes facts not in evidence.<br />
<input name="Objection" type="radio" value="2"<? print($pref_info['Objection'] == '2')? " checked" : ""; ?> Objection. Vague; asumes facts not in evidence.<br />
<input name="Objection" type="radio" value="1"<? print($pref_info['Objection'] == '1')? " checked" : ""; ?> Objection. Vague. Assumes facts not in evidence.<br />
<input name="Objection" type="radio" value="0"<? print($pref_info['Objection'] == '0')? " checked" : ""; ?> Objection; vague, assumes facts not in evidence.<br />
<input type="radio" name="Objection" onmouseup="textbox(this,'Objection')"/>Other:<noscript><input type="text" name="Objection" width="250" value="" /></noscript>
</TD>
</tr>
<tr>
<TD WIDTH="36%" class="main">
:Ante meridiem/post meridiem abbreviation preference
</TD>
<TD WIDTH="64%" class="main" valign="top">
<input name="Meridiem" type="radio" value="2"<? print($pref_info['Meridiem'] == '2')? " checked" : ""; ?> a.m./p.m.
<input name="Meridiem" type="radio" value="1"<? print($pref_info['Meridiem'] == '1')? " checked" : ""; ?> AM/PM
<input name="Meridiem" type="radio" value="0"<? print(!isset($pref_info['Meridiem']) || $pref_info['points'] == '0')? " checked" : ""; ?> A.M./P.M. </TD>
</tr>
<tr bgcolor="#e8e8e8">
<TD WIDTH="36%" class="main">
:Spelling out words or “stitching” preference
</TD>
<TD WIDTH="64%" class="main" valign="top">
<input name="Stitching" type="radio" value="2"<? print($pref_info['Stitching'] == '2')? " checked" : ""; ?> All caps with dashes (C-A-T)<br />
<input name="Stitching" type="radio" value="1"<? print($pref_info['Stitching'] == '1')? " checked" : ""; ?> Lowercase with dashes (c-a-t)<br />
<input name="Stitching" type="radio" value="0"<? print( $pref_info['Stitching'] == '0')? " checked" : ""; ?> First-letter cap with dashes (C-a-t)<br />
<input type="radio" name="Stitching" onmouseup="textbox(this,'Stitching')"/>Other:<noscript><input name="Stitching" width="250" type="text" value="" /></noscript>
</TD>
</tr>
<tr>
<td> <input type="submit" border=0 value="Submit" alt="Submit Enquiry" name="image"></td>
</tr>
</table>
</form>
</body>
</html>
I also put in the submit button so I could test it
Bookmarks