Perhaps a very dumb question - problems with forms

Results 1 to 2 of 2

Thread: Perhaps a very dumb question - problems with forms

  1. #1
    Christiaan Verwijs Guest

    Default Perhaps a very dumb question - problems with forms

    This is the situation:<BR><BR>I have a checkbox, and a hidden formfield. What i want to do is to set the hidden field to TRUE when the checkbox is checked, and FALSE when it is unchecked (don&#039t ask me why, i really have to do it this way - i know what i&#039m doing). To do this, i have a ONCLICK-event for the checkbox.<BR><BR>To perform this action, i&#039ve written a function:<BR><BR>function ChangeCheck(name, actual)<BR>{<BR> if( == TRUE) <BR> {<BR> document.form.actual.value = "TRUE" <BR> }<BR> else<BR> {<BR> document.form.actual.value = "FALSE"<BR> }<BR>}<BR><BR>Now, the problem arises when working with the &#039actual&#039 variable. When i call the function for the checkbox. I can use this function-call:<BR><BR>ChangeCheck(this, &#039check2&#039). The problem here is that the second parameter of the string-type and is not accepted by the function.<BR><BR>How can i solve this problem? Can i convert the string to an object?

  2. #2
    FRanco Guest

    Default RE: Perhaps a very dumb question - problems with f

    Christian,<BR><BR>can you not use the change event of the checkbox and then use the not(checkbox.value) eg in VB it would look like:<BR><BR>Sub MyChkBox_Change()<BR>hiddenbox=not(mychkbox.value) <BR>end sub<BR><BR>that would make sure that the hidden box always had the opposite value to the checkbox<BR><BR>hth<BR><BR>franco<BR>lokidude@hotm

Posting Permissions

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