...

View Full Version : OnClick event not working



milescook
02-14-2007, 12:23 PM
I have tried every variant of javascript, cannot get this to work:


<form name="form" action="resultsmaps.asp" method="submit">
<table width="400" border="1">
<tr>
<td width="71">Author:</td>
<td width="22">


<input name="authorTick" type="checkbox" id="authorTick" onclick"document.form.authorField.disabled=false;" value="checkbox" /></td>

<td width="293"><input name="authorField" type="text" id="authorField" disabled="disabled"/></td>

when I click the textbox the field does not enable.

Please help!

shyam
02-14-2007, 01:06 PM
<form name="form" action="resultsmaps.asp" method="submit">
<table width="400" border="1">
<tr>
<td width="71">Author:</td>
<td width="22">


<input name="authorTick" type="checkbox" id="authorTick" onclick"document.form.authorField.disabled=false;" value="checkbox" /></td>

<td width="293"><input name="authorField" type="text" id="authorField" disabled="disabled"/></td>

you sure din't try putting an '=' between onclick and the text literal

milescook
02-14-2007, 03:05 PM
Whoops! Well now I feel stupid!

Anyway, even though a straight statement works I can't get a condition working. Can anyone help?


<form name="form" action="resultsmaps.asp" method="submit">
<table width="400" border="1">
<tr>
<td width="71">Author:</td>
<td width="22">


<input name="authorTick" type="checkbox" id="authorTick" onclick="if (document.form.authorTick.checked) document.form.authorField.disabled=false else document.form.authorField.disabled=true;" value="checkbox" /></td>
<td width="293"><input name="authorField" type="text" id="authorField" disabled="disabled"/></td>



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum