This topic is locked

Readonly Total Field

12/1/2012 1:06:02 AM
PHPRunner General questions
F
fawad112 author

Hi,
I have a field on add page that calculates the total of 2 different values. I want that field to be readonly. I have tried javascript isReadonly makeReadonly... Readonly from the phrunner editor but none of them is working. I even tried make it read only from the HTML. None of them is working. Some just disables the field but then it does not calcuate the value.



var ctrlPrice=Runner.getControl(pageid,'pagesreq');
var ctrlQuantity=Runner.getControl(pageid,'price');
var ctrlTotal=Runner.getControl(pageid,'tot');

function func()

{
if(ctrlPrice.getValue()!=''&&ctrlQuantity.getValue()&&!isNaN(ctrlPrice.getValue())&&!isNaN(ctrlQuantity.getValue()))
ctrlTotal.setValue(parseFloat(ctrlPrice.getValue())*parseFloat(ctrlQuantity.getValue()));
else
ctrlTotal.setValue('');
}

;
ctrlPrice.on('change',func);
ctrlQuantity.on('change',func);


what ctrlTotal to be readonly.
Any Help.
Thanks

C
cgphp 12/1/2012

What version of PHPrunner are you using?

F
fawad112 author 12/1/2012

5.3

C
cgphp 12/1/2012

May be a bug. Upgrade to the latest version.

F
fawad112 author 12/1/2012

Hi,
Updated to latest and again tested everything. Still not working.

C
cgphp 12/1/2012

Do you get any errors in the Firebug's console?