Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Feb 2007
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    OnClick event not working

    I have tried every variant of javascript, cannot get this to work:

    Code:
    <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!

  • #2
    Senior Coder shyam's Avatar
    Join Date
    Jul 2005
    Posts
    1,563
    Thanks
    2
    Thanked 163 Times in 160 Posts
    Quote Originally Posted by milescook View Post

    Code:
    <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

  • #3
    New to the CF scene
    Join Date
    Feb 2007
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Whoops! Well now I feel stupid!

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

    Code:
    	  <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>


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •