Jump to content

Disable A Group Box By Java


Recommended Posts

Hi I want disable some objects that are in a 'group Box' in one step by java.I can disable these object one by one But I search for a method to one step disable this is my code for disabling one single object (T25):

document.Form1.T25.disabled = true

but I have problem with this:

document.Form1.Group box1.disabled = true;

the Group box don't have even NAME attribute.1- How can I manage 'Group box' in this case?2- is there any thing instead of 'Group box' to grouping? Thanks a lot

Link to comment
Share on other sites

Alrighty, I'm not sure of this, but it sounds like it makes good sense. Could you put the group box inside of a div or span element, name the element (span id="pinkfloydrules"/span), and then just use styling to hide that element? Something like this perhaps:

[font="Courier New"]div id="pinkfloydrules"     ---checkbox code---  /div  script type="text/javascript"     document.getElementById("pinkfloydrules").style.display = "none";  /script[/font]

And then you can re-display that element using something like this:

[font="Courier New"]document.getElementById("pinkfloydrules").style.display = "block";[/font]

There're all sorts of different display types, too, like "table-row" and such, but you'd have to look up a list that enumerates those types. I think you'll want to use "block", though. P.S. Notice I had to omit the "<" characters. The forum tries to parse that stuff, so some of it'll show up on the posting, and other parts won't. And it looks ugly and gets hard to read when you have html boxes and such in the posting. So, be aware that some pertinent characters may be missing in the code I've displayed.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Create New...