Jump to content
  • 0

Trouble with Checkbox --Collapsible Sections


havingtrouble

Question

An earlier poster asked about how to do collapsible sections using a checkbox in a datapage:

(viewtopic.php?f=3&t=12483)

and which was solved with an example of using a virtual field checkbox. However, I am having trouble duplicating that solution when using a regular field checkbox. Could someone tell me what I am doing wrong?

(script from previous post that used virtual field checkbox and which works when I try to use it)

-------------------------------------------------

Code:

Hello there !

function check(){

if(document.getElementById('cbParamVirtual1').checked)

{document.getElementById('displayer').style.display ="inline";}

else

{document.getElementById('displayer').style.display ="none";}

}

document.getElementById('cbParamVirtual1').onchange = check;

--------------------------------------------------

I am trying to replace the virtual field checkbox with a regular field checkbox. In my case, my fieldname is Door and which is a checkbox.

However, when I use fieldname Door in the above script it does not work, for instance:

-----------------------------------------------------

Code:

Hello there !

function check(){

if(document.getElementById('Door').checked)

{document.getElementById('displayer').style.display ="inline";}

else

{document.getElementById('displayer').style.display ="none";}

}

document.getElementById('Door').onchange = check;

-----------------------------------------------------

Please let me know why a regular field checkbox is not working but a virtual one would and can someone post the proper script that will work.

Link to comment
Share on other sites

3 answers to this question

Recommended Posts

  • 0

Hi,

I noticed that you use document.getElementById('Door') when refer to the checkbox field. Although the field is called 'Door' in the source table, it's ID is actually different in a real form. If it's a web form, the ID would be 'InsertRecordDoor'. And on an update or details form, the ID will be "EditRecordDoor".

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...