How to add two fields and display in text area?
Hello,
I am looking to add two fields upon value change. I have input fields "mp" & "ap". How do I have the total of the fields display in text area "totalprice"? Thank you!
Catch up wih the Appery.io community on our forum. Here you'll find information on the lastest questions and issues Appery.io developers are discussing.
https://forum.appery.io/
Hello,
I am looking to add two fields upon value change. I have input fields "mp" & "ap". How do I have the total of the fields display in text area "totalprice"? Thank you!
Read the values from input fields, then update the text area via JavaScript.
Hi Max,
I am trying to do this but I am running into issues. My current code is:
var input = Tiggr('AP');
var input = Tiggr('MP');
alert( Number(MP) + Number(AP) );
I am trying to have them display in the text area "totalprice"
Any help would be very appreciated.
Tiggzi('component_name') returns the jQuery Mobile element. You need to add .val() for inputs or .text() for labels -- to get the actual value. It's jQuery and jQuery Mobile API: http://docs.tiggzi.com/javascript-api/. Tiggz(...) is just a small helper function, to get the element in the DOM.
So, in your case, it should be Tiggzi('AP').val();
Hi Max,
When I use Tiggzi('AP').val(); it does not return anything. How do I have it add AP and MP upon value changes on the input fields? Thank you very much.
I have also tried: Tiggzi('TotalCost').val()Tiggzi('AP').val()+Tiggzi('MP').val();
But that will not work either.
The component name is 'AP'? How or where do you invoke the JavaScript?
I have Input component names: AP & MP and I have textare component: TotalPrice
I call javascript upon value change of MP & AP
Try to run the JS on button click.
I tried on button click but that did not work either.