July 24, 2007, 08:11 PM
getitResource Layout - Button Onclick checkbox
Hi ,
I have around 20 checkboxes on my form and I would like to create a onclick event for button so that all the checkboxes are selected if the button is clicked?
I tried using
function button2_onclick(ctrl) {
document.getElementByID(checkbox1).Checked = false;
document.getElementByID(checkbox2).Checked = false;
document.getElementByID(checkbox3).Checked = false;
document.getElementByID(checkbox4).Checked = false;
...
...
...
...
...
}
but it didn't work . ANy ideas.?
July 25, 2007, 02:41 AM
Alan BVery nearly there. The id must be in quotes (single or double), the word checked must be all lower case, and it is getElementById, javascript is case sensitive.
Also do check the actual id, next to the INPUT, I think it will be something like checkbox1_0.
function button2_onclick(ctrl) {
document.getElementById("checkbox1_0").checked = false;
document.getElementById("checkbox2_0").checked = false;
document.getElementById("checkbox3_0").checked = false;
document.getElementById("checkbox4_0").checked = false;
...
...
...
...
...
}
That should work now.
July 25, 2007, 02:51 AM
Tony A... but if you want the checkboxes "selected" (do you mean "checked"?) then you should use "true" instead of "false" ...
T
July 25, 2007, 02:59 AM
FrankDutchis this a webfocus forum or a javascript forum??
July 25, 2007, 03:10 AM
Tony AFrank,
The boundaries are getting ever more blurred owing to the fact that, often, developers will need to know and understand HTML and JavaScript as well as they know and understand WebFOCUS. Especially if they want to leverage more out of the whole WF experience.
We could say "go look at a JavaScript forum" but at least this Guy had the sense to try to get a solution before posting
T
p.s. How are the water levels?
July 25, 2007, 07:55 AM
FrankDutchYes I understand that Tony, and I do not mind, systems are getting more and more mixed with all kind of software and in fact that is what keeps me having a job....
about the water levels, we here in the Netherlands are just to it, a report in the local paper stated today that since we always pump the water never comes to high, only if and when it rains a lot in Germany/Switserland the Rijn gets to much water so we can get a little problem.
Winter storms are always a bigger problem but since the flood in 1952 we have managed that rather good.
Do you live in that flooded area?
July 25, 2007, 09:33 AM
getitHi AlanB,
Its working now. Thanks a lot.
Tony,
Thanks for understanding the issue.I have tried a lot of javascript sites and thought someone on webfocus forum might provide some insight. It definitely helped me to keep my current page developed in resource layout.