brooky
04-05-2007, 12:15 PM
Hello,
I've created the following code but I can't understand why it won't work.
findObj was created by Dreamweaver which is basically a better solution that find object by id:
function toggleReg()
{
if(findObj('password').disabled=false && findObj('passwordConf').disabled=false)
{
findObj('password').disabled=true;
findObj('passwordConf').disabled=true;
}
else
{
findObj('password').disabled=false;
findObj('passwordConf').disabled=false;
}
}
<tr>
<td colspan="4">I do not want to create an account
<input type="checkbox" name="account" value="1" onclick="toggleReg();" /></td>
</tr>
<tr>
<td>Password</td>
<td><input name="password" type="password" class="textbox" id="password" size="16" value="" tabindex="13" /> * </td>
<td>Confirm Password</td>
<td><input name="passwordConf" type="password" class="textbox" id="passwordConf" size="16" value="" tabindex="14" />
* </td>
</tr>
Can anyone see why it won't work? I'm a fairly competent coder but useless with JavaScript.
I've created the following code but I can't understand why it won't work.
findObj was created by Dreamweaver which is basically a better solution that find object by id:
function toggleReg()
{
if(findObj('password').disabled=false && findObj('passwordConf').disabled=false)
{
findObj('password').disabled=true;
findObj('passwordConf').disabled=true;
}
else
{
findObj('password').disabled=false;
findObj('passwordConf').disabled=false;
}
}
<tr>
<td colspan="4">I do not want to create an account
<input type="checkbox" name="account" value="1" onclick="toggleReg();" /></td>
</tr>
<tr>
<td>Password</td>
<td><input name="password" type="password" class="textbox" id="password" size="16" value="" tabindex="13" /> * </td>
<td>Confirm Password</td>
<td><input name="passwordConf" type="password" class="textbox" id="passwordConf" size="16" value="" tabindex="14" />
* </td>
</tr>
Can anyone see why it won't work? I'm a fairly competent coder but useless with JavaScript.