refresh a script

26 views
Skip to first unread message

nano...@gmail.com

unread,
Jan 7, 2015, 2:27:25 PM1/7/15
to suppor...@runmyprocess.com
I need help with a script.

I have 2 textbox with nummbers parameters and I need to get the numbers and then sum and show the result in a third text box. In the third textbox I put a script with this function widgetID.getNumber(): it only works when I have a predefined number in the first text box for example. How can I get the two parameters numbers and the sum it?

Pankaj Kumar

unread,
Jan 7, 2015, 9:10:33 PM1/7/15
to suppor...@runmyprocess.com, nano...@gmail.com
Hi,

For achieving this, the sum code should be executed if any of the input value changed. You can use a js widget and write the code to sum the two input number and assign the result in the 3rd input, and on "listen to variable" property, give both the input variable name.

If any of the input value is changed, js code will be executed and update the value in 3rd input.

You can also use the jquery change event for this, jquery library is included in Web Interface by default.

Thanks & Regards,
Pankaj Kumar



On Thu, Jan 8, 2015 at 12:57 AM, <nano...@gmail.com> wrote:
I need help with a script.

I have 2 textbox with nummbers parameters and I need to get the numbers and then sum and show the result in a third text box. In the third textbox I put a script with this function widgetID.getNumber():  it only works when I have a predefined number in the first text box for example. How can I get the two parameters numbers and the sum it?

--
Fujitsu - RunMyProcess
---
You received this message because you are subscribed to the Google Groups "RunMyProcess Support Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to supportforum...@runmyprocess.com.
To post to this group, send email to suppor...@runmyprocess.com.
Visit this group at http://groups.google.com/a/runmyprocess.com/group/supportforum/.
To view this discussion on the web visit https://groups.google.com/a/runmyprocess.com/d/msgid/supportforum/efbd05e4-5355-417d-878e-24b58a4bcc83%40runmyprocess.com.
For more options, visit https://groups.google.com/a/runmyprocess.com/d/optout.

Pankaj Kumar

unread,
Jan 10, 2015, 3:05:14 AM1/10/15
to suppor...@runmyprocess.com, Hernan Alberto Del Campo Cabezas
Hi,

Please find the sample code, add this code in a js widget:-

var num1 = id_input1.getNumber();
var num2 = id_input2.getNumber();
//alert(num1+"    "+num2);
var num3 = Number(num1) + Number(num2);
id_result.setNumber(num3);


On jswidget, property panel :- "Listen to varialble" add input2,input1. for executing the code if any input value is changed.


Best Regards,
Pankaj

Reply all
Reply to author
Forward
0 new messages