This topic is locked

Wait dont work! i don understand

5/9/2014 11:24:17 PM
ASPRunnerPro General questions
V
virtualkaiser author

I'm using this sample in event javascript but dont work!!!
I am entering the field value amount on the form.

the price is when I select the item.
I need to do :
*Total = Amount Price*
var ctrlAmount = Runner.getControl(pageid, 'Amount');

var ctrlPrice = Runner.getControl(pageid, 'Price');

var ctrlTotal = Runner.getControl(pageid, 'Total');
function func() {

ctrlTotal.setValue(ctrlAmount.getValue()
ctrlPrice.getValue());

};
ctrlAmount.on('keyup', func);

ctrlPrice.on('keyup', func);
Tks <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=question&id=22261&image=1&table=forumtopics' class='bbc_emoticon' alt=':rolleyes:' />

Sergey Kornilov admin 5/10/2014

Make sure that field names are correct (case-sensitive). Here is the article that can help you understand what exactly is not working:

http://xlinesoft.com/blog/2012/05/22/how-to-troubleshoot-javascript-errors/

V
virtualkaiser author 5/10/2014



Make sure that field names are correct (case-sensitive). Here is the article that can help you understand what exactly is not working:

http://xlinesoft.com/blog/2012/05/22/how-to-troubleshoot-javascript-errors/


Uncaught TypeError: undefined is not a function


why i don understand!!!
Hi, I make an example and add those fields in javascript events code but that does not work ... I do not understand.

im take this code :
var ctrlPrice = Runner.getControl(pageid, 'Price');

var ctrlQuantity = Runner.getControl(pageid, 'Quantity');

var ctrlTotals = Runner.getControl(pageid, 'Total');
function func() {

ctrlTotals.setValue(+ctrlPrice.getValue()*+ctrlQuantity.getValue());

};
ctrlPrice.on('keyup', func);

ctrlQuantity.on('keyup', func)
but dont work, i need you one sample file. tkx

Sergey Kornilov admin 5/10/2014

Unfortunately there is not enough info to provide a meaningful answer. If you need more help 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.

G
gonzalosb 5/13/2014

hi virtualkaiser,

I notice that you missing few "( )" on the function.

try it this way

function func() {

ctrlTotal.setValue(Number(ctrlPrice.getValue()) * Number(ctrlQuantity.getValue()));

}



please let us know if this help you