This topic is locked
[SOLVED]

 Checkbox

12/3/2011 5:43:30 PM
PHPRunner General questions
S
salim author

I have a couple of checkboxes in a form, when a user checks the admin access box, the other two boxes ALoc and ELoc should be checked automatically.
The onload javascript event is not working. the code is append below.

Would appreciate it very much for any help to solve it.
Thanks
Code:

var ctrlAdminAccess = Runner.getControl(pageid, 'adminAccess');

var crtlALoc = Runner.getControl(pageid, 'ALoc');

var ctrlELoc = Runner.getControl(pageid, 'ELoc');
ctrlAdminAccess.on('click', function(e) {

if (this.getValue() == "on") {

ctrlALoc.setValue("on");

ctrlELoc.setvalue("on");

alert('OK it is on');

} else {

ctrlALoc.setValue("");

ctrlELoc.setValue("");

}

});

C
cgphp 12/4/2011
var ctrlAdminAccess = Runner.getControl(pageid, 'adminAccess');

var crtlALoc = Runner.getControl(pageid, 'ALoc');

var ctrlELoc = Runner.getControl(pageid, 'ELoc');
ctrlAdminAccess.on('click', function(e) {

if(this.getDispElem().is(':checked'))

{

ctrlALoc.getDispElem().attr('checked',true);

ctrlELoc.getDispElem().attr('checked',true);

alert('OK it is on');

}

else

{

ctrlALoc.getDispElem().attr('checked',false);

ctrlELoc.getDispElem().attr('checked',false);

}

});
S
salim author 12/4/2011


var ctrlAdminAccess = Runner.getControl(pageid, 'adminAccess');

var crtlALoc = Runner.getControl(pageid, 'ALoc');

var ctrlELoc = Runner.getControl(pageid, 'ELoc');
ctrlAdminAccess.on('click', function(e) {

if(this.getDispElem().is(':checked'))

{

ctrlALoc.getDispElem().attr('checked',true);

ctrlELoc.getDispElem().attr('checked',true);

alert('OK it is on');

}

else

{

ctrlALoc.getDispElem().attr('checked',false);

ctrlELoc.getDispElem().attr('checked',false);

}

});




Thanks a lot it is working now. <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=reply&id=62870&image=1&table=forumreplies' class='bbc_emoticon' alt=':D' />