Having problem with my function...

Results 1 to 2 of 2

Thread: Having problem with my function...

  1. #1
    Join Date
    Dec 1969

    Default Having problem with my function...

    I am trying to use a function that checks the value of 1 checkbox, and if that checkbox is check, it disables three other checkboxes. Here is the function that I tried to build:<BR><BR>&#060;SCRIPT Language="JavaScript"&#062;<BR> &#060;!--<BR> function Checkboxes(){<BR> if document.sheriff.chk_sus_use_n.checked = true;{ // check if this character is a " " character<BR> document.sheriff.chk_sus_use_a.disabled = true;<BR> document.sheriff.chk_sus_use_d.disabled = true;<BR> document.sheriff.chk_sus_use_c.disabled = true; // write a break tag in it&#039;s place<BR> }<BR> else{ //otherwise <BR> document.sheriff.chk_sus_use_a.disabled = false;<BR> document.sheriff.chk_sus_use_d.disabled = false;<BR> document.sheriff.chk_sus_use_c.disabled = false; // write the character<BR> }<BR> }<BR> // --&#062;<BR> &#060;/SCRIPT&#062;<BR><BR>I call it when the user clicks on the checkbox chk_sus_use_n with this code:<BR><BR>onClick="checkboxes();"<BR><BR>But it is not working, and when I click on the checkbox, I see an "Error on page" message in bottom left corner of browser and when I click on that I get the message:<BR><BR>Object Expected<BR><BR>Can anyone tell me what I am doing wrong?

  2. #2
    Join Date
    Dec 1969

    Default Case sensitivity.

    function [hl="yellow"]C[/hl]heckboxes(){<BR><BR>onClick="[hl="yellow"]c[/hl]heckboxes();"

Posting Permissions

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