This topic is locked
[SOLVED]

 Action after Changed value

3/21/2010 12:31:08 PM
PHPRunner General questions
W
wlueckemann author

Hello,
again thanks for the quick help -- and excuse my bad English. <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=question&id=14105&image=1&table=forumtopics' class='bbc_emoticon' alt=':rolleyes:' />

I still have a problem.
I have two fields (Brutto_Netto and ProvSatz)

BruttoNetto can take on the lookup wizard, the values B and N.
Now the question:
How can I set ProvSatz to 0 if BruttoNetto gets the value N .
Thanks for a Tip
Walther

D
danaci 3/21/2010

after add or after edit event code
if ($values["BrutoNetto"]=="N")

{

$values["ProvSatz"]=0;

}

W
wlueckemann author 3/22/2010

Hi Danaci,
Thanks!
this works imho after pressing the "edit OK". I'm searching for a way, that the "Provsatz" is set to 0 immediately after changing the "BruttoNetto"
Do you know how to do this?
Regards

Walther



after add or after edit event code
if ($values["BrutoNetto"]=="N")

{

$values["ProvSatz"]=0;

}

A
aalekizoglou 3/22/2010

Maybe this can help you
Forum PHPR5.2 onload Javascript



// table name

var tName = 'youtable';
var lBrutoNetto = 'BrutoNetto';

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

var ctrlProvSat = Runner.controls.ControlManager.getAt(tName, pageid, iProvSat);
ctrlBrutoNetto.on('change', function(e){

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

ctrlProvSat.setValue(0);

}

});


You can put this into the OnLoad event of the desired table. You need to change tName var to your tablename.
Of course as Sergey wrote in the forum this is new and not described in the manual, but I have used it a couple of times.

W
wlueckemann author 3/23/2010
Sergey Kornilov admin 3/23/2010

Athanasios,
we are working on updated manual. Will be available shortly.