powpow Posted February 10, 2011 Share Posted February 10, 2011 I am having issue creating a checkbox that uses a onClick() js method. I believe this might be due to the fact that I am echoing the html but if any one could help id appreciate it. echo "<tr><td>WrkComp</td><td><input type='checkbox'" ?> <script>onClick="show()" </script> <? "name='WrkComp[]' value='DEP' '.$checked.' '.$Disabled.'/></td>"; Quote Link to comment Share on other sites More sharing options...
pornophobic Posted February 10, 2011 Share Posted February 10, 2011 I don't see why you are including you onclick in script tags? echo '<tr><td>WrkComp</td><td><input type="checkbox" onclick="show()" name="WrkComp[]" value="DEP" ' . $checked . ' ' . $Disabled . '/></td>'; Edit: onclick validates where onClick does not. Quote Link to comment Share on other sites More sharing options...
solon Posted February 10, 2011 Share Posted February 10, 2011 Just do the following: When echoing a onclick() event in your code you dont need to do anything different than what you do when echoing lets say 'name' pr any other attribute name of a tag. echo "<tr><td>WrkComp</td><td><input type='checkbox' onClick='show()' name='WrkComp[]' value='DEP' '.$checked.' '.$Disabled.'/></td>"; Quote Link to comment Share on other sites More sharing options...
powpow Posted February 10, 2011 Author Share Posted February 10, 2011 Well some how through my problem solving I skipped step 1. Thank you for your solutions. Edit: onclick validates where onClick does not. Can you supply me a link about onclick? I did a quick "onclick vs onClick" google search and nothing came up. Thanks again! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.