Focal Point
Resource Layout - Button Onclick checkbox

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/3581095832

July 24, 2007, 08:11 PM
getit
Resource 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.?


App Studio Version 8202
windows Platform
SQL Server 2008/2012
July 25, 2007, 02:41 AM
Alan B
Very 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.


Alan.
WF 7.705/8.007
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



In FOCUS
since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.06 standalone on Windows 10 
July 25, 2007, 02:59 AM
FrankDutch
is this a webfocus forum or a javascript forum??




Frank

prod: WF 7.6.10 platform Windows,
databases: msSQL2000, msSQL2005, RMS, Oracle, Sybase,IE7
test: WF 7.6.10 on the same platform and databases,IE7

July 25, 2007, 03:10 AM
Tony A
Frank,

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 Wink

T

p.s. How are the water levels?



In FOCUS
since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.06 standalone on Windows 10 
July 25, 2007, 07:55 AM
FrankDutch
Yes 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?




Frank

prod: WF 7.6.10 platform Windows,
databases: msSQL2000, msSQL2005, RMS, Oracle, Sybase,IE7
test: WF 7.6.10 on the same platform and databases,IE7

July 25, 2007, 09:33 AM
getit
Hi 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.


App Studio Version 8202
windows Platform
SQL Server 2008/2012