This topic is locked
[SOLVED]

Button Switch hide or Show fields

12/2/2021 10:01:54 AM
PHPRunner General questions
I
Ivan van Oosterhout author

Hello,

I have downloaded the Toggle switch from Fernando, look great.
I have call this field switch.

On the ADD page i want to toggle with the switch and hide or Show Fields.
So i push the button ON, show fields and OFF hide the fields. Not 1 time push but everytime when you hit the switch.

Can somebody advice me please,

JavaScript Onload event:

var ctrl = Runner.getControl(pageid, 'switch');
ctrl.on('change', function(e){
if (this.getValue() == 1){
pageObj.toggleItems( [
'integrated_edit_field6',
'integrated_edit_field4',
'integrated_edit_field2',
'integrated_edit_field3',
'integrated_edit_field8',
'integrated_edit_field7'
], true );
} else {
pageObj.toggleItems( [
'integrated_edit_field6',
'integrated_edit_field4',
'integrated_edit_field2',
'integrated_edit_field3',
'integrated_edit_field8',
'integrated_edit_field7'
], false );
}
}
)

admin 12/2/2021

I guess only Fernando can answer this question. You may want to contact him directly.

fhumanes 12/5/2021

Hello,

I think I've already answered it in personal communication.

There is plugin that can not be hidden with JavaScript, this also happens to standing components as a FILES. This is because there are several HTML objects and PHPRunner's standard functions are not designed for these cases.

This does not happen in all cases, only those who are complex in their representation.

I do not connect this forum every day, nor follow my publications, so I beg you if you require something from me, I get in touch through my email fernandohumanes@gmail.com

Greetings,
fernando