View Single Post
  #3 (permalink)  
Old 08-04-2008, 08:18 AM
Lori Lori is offline
Registered User
 
Join Date: Aug 2008
Posts: 2
Thanks but...

I'm getting syntax errors returned and I'm not able to make it work. I imagine it's something to do with how I've incorporated the code into my form as your code looks fine to me. Here's what I'm doing minus much of the normal HTML:

Code:
<script type="text/javascript">
<input type="checkbox" name="cb" id="cb1" value="1" onchange="showfield(this)" />
<input type="checkbox" name="cb" id="cb2" value="2" onchange="showfield(this)" />
<input type="text" name="text1" id="text1" />
<input type="text" name="text2" id="text2" />
<script type="text/javascript" language="javascript">
function showfield(what) {
if(what.id = "cb1" && what.checked) {
document.getElementById('text1').style.display = "inline";
}
else if(what.id = "cb1" && !what.checked) {
document.getElementById('text1').style.display = "none";
}
else if(what.id = "cb2" && what.checked) {
document.getElementById('text2').style.display = "inline";
}
else if(what.id = "cb2" && !what.checked) {
document.getElementById('text2').style.display = "none";
}
else {
document.getElementById('text1').style.display = "none";
document.getElementById('text2').style.display = "none";
}
}
</script>

<table>
	<tr>
		<td class=m>Badgering</td>
		<td class=m><input type=checkbox size=10 name=cb1>	
		<td>Timestamp(s)</td>
		<td class="m"><input type="text" size="40" name="text1"></td>	
		
	</tr>
</div>
<tr>
	<td class=m>Credit(s) Promised</td>
	<td class=m><input type=checkbox size=10 name=cb2>
			<td width="85">Timestamp(s)</td>
			<td class=m><input type="text" size="40" name="text2"></td>
			<td class=m>Credit Amount</td>
			<td class=m><input type=text size=10 name=_fid_14 ></td>
			<td class=m>Credit Applied</td>

			<td class=m><select  name=_fid_15 >
				<option></option>
				<option>Yes</option>
				<option>No</option>
			</select>
		</td>
		
</tr>

</table>
Thanks again
Reply With Quote