This topic is locked
[SOLVED]

 Validate Custom Button

8/25/2014 1:12:24 AM
PHPRunner General questions
H
headingwest author

Hi,
I have a button "Save and Pay" that saves an order form and submits the payment to Paypal.
How can I validate in the buttons "Client Before" event that the quantity field (co_qty) has a number from 1 to 100??
Thanks for your help.

Sergey Kornilov admin 8/25/2014

Try something along these lines:

var ctrl=Runner.getControl(1,'qty');

var qty=Number(ctrl.getValue());

if (qty<1 || qty>100) {

// do something

}