This topic is locked
[SOLVED]

 Confirm Action Message Box

10/9/2013 12:38:35 PM
PHPRunner General questions
C
CWDATA author

I would like to be able to have a Pop Up confirm Action Yes?No box after my user places a tick in a Check Box.
Can anyone help me with please?
Regards.

Carl.

C
cgphp 10/9/2013
var ctrl = Runner.getControl(pageid, 'my_field_name');
ctrl.on('click', function(e, argsArr){

if (ctrl.getValue() == 'on')

{

if( ! confirm("Are you sure?"))

{

this.setValue('');

}

}

});


Replace my_field_name with the real name of your field.

C
CWDATA author 10/9/2013


var ctrl = Runner.getControl(pageid, 'my_field_name');
ctrl.on('click', function(e, argsArr){

if (ctrl.getValue() == 'on')

{

if( ! confirm("Are you sure?"))

{

this.setValue('');

}

}

});


Replace mi_field_name with the real name of your field.


Fantastic mate very much appreciated. Where should I drop the code?

Cheers,

Carl.

C
cgphp 10/9/2013

Put the code in the "Javascript onload" event of the add/edit page where you have the checkbox.