This topic is locked
[SOLVED]

 Javascript API in Edit

3/27/2010 2:54:37 AM
PHPRunner General questions
W
wlueckemann author

Hallo!
I want to hide a control in dependency of an other.
The only way I found was blur on the first control - but it looks a little bit amusing: The control is on page and when I try to click on it, it disappears.
Now the question:
Is there an event, firing when showing the form?
Thanks for a tip.

-----
Solved: Just doing it outside an event.
Walther

F
FunkDaddy 3/28/2010

This post was marked as solve. Could you please share the answer.. I am trying to do the same exact thing (disable/enable form fields based on selection of others).
Thanks in advance for your help.
Cheers,
M

W
wlueckemann author 3/28/2010

Hallo !
This is the code in JavaScript OnLoad event:
// table name

var tName = 'vertrag';
// Assign controls

var lBrutoNetto = 'Brutto_Netto';

var ctrlBrutoNetto = Runner.controls.ControlManager.getAt(tName, pageid, lBrutoNetto);
var iProvSatz = 'Provisionssatz';

var ctrlProvSat = Runner.controls.ControlManager.getAt(tName, pageid, iProvSatz);
// hide Element at the beginning if BruttoNetto = N

if ( ctrlBrutoNetto.getValue() == "N")

{

ctrlProvSat.hide();

}
ctrlBrutoNetto.on('change', function(e){

if (this.getValue() == 'N')

{

if (ctrlProvSat.getValue() != 0 )

{

if (confirm("Sie haben Netto gewählt. Der Provisionsatz wird gelöscht! " + ctrlProvSat.getValue() ))

{

ctrlProvSat.setValue(0);

ctrlProvSat.hide();

}

else

{

ctrlBrutoNetto.setValue("B");

ctrlProvSat.show();

}

}

else

{

ctrlProvSat.hide();

}

}

else // es wurde B eingeben

{

ctrlProvSat.show();

}
})

;
If there are more questions ...
Regards
Walther