This topic is locked

Java greater then 0 or Nothing filled in.

7/4/2014 4:03:47 AM
PHPRunner General questions
I
Ivan van Oosterhout author

Hi,
Can Somebody help me please with this code,
One or more Fields must be filled in with a value but it must be greater the 0, i think underneath is wrong.



var ctrlPAL = Runner.getControl(pageid,'pallets_aangemeld');

var ctrlCTN = Runner.getControl(pageid,'dozen_aangemeld');

var ctrlGOH = Runner.getControl(pageid,'hang_aangemeld');

var ctrlALL = Runner.getControl(pageid,'pallets_aangemeld','dozen_aangemeld','hang_aangemeld');
ctrlALL.addValidation('IsRequired');
this.on('beforeSave', function(formObj, fieldControlsArr, pageObj){

if(ctrlPAL.getValue() == '' && ctrlPAL.getValue() == 0 && ctrlCTN.getValue() == '' && ctrlCTN.getValue() == 0 && ctrlGOH.getValue() == '' && ctrlGOH.getValue() == 0)

{

ctrlALL.validate();

}

else

{

ctrlALL.removeValidation('IsRequired');

}

});
I
Ivan van Oosterhout author 7/14/2014

Anyone?

Sergey Kornilov admin 7/14/2014

My guess is that

ctrlPAL.getValue() == '' && ctrlPAL.getValue() == 0

is not correct as the same value cannot be empty string and zero at the same time.
However it's hard to tell what might be wrong without seeing your live application. If you have a support contract post your application to Demo Account and open a ticket at http://support.xlinesoft.com sending your Demo Account URL. 'Demo Account' button can be found on the last screen in the program.