facebook

Text Field * Text Field = Text Want a Value here: CLOSED

💡
Our Forums Have Moved

For help with installation, bugs reports or feature requests, please head over to our new forums.
Genuitec Community on GitHub

  1. MobiOne Archive
  2.  > 
  3. Getting Help – General
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #327944 Reply

    Hello:

    I have a text field * a text field and it places the results in text. I want to be able to perfom additional calculations on the results but I can’t because it is text. How do I do this?

    Here is my code:
    function updateproLostSalesText() {
    //read Work Days in POR X average daily sales input values
    // inspect the html file to get the field IDs
    var res1 = parseInt($(‘#m1-RESULTS-results5Field’).val(), 10);
    var res2 = parseInt($(‘#m1-RESULTS-results6Field’).val(), 10);

    //convert all non-numeric (NaN) inputs to 0
    res1 = isNaN(res1) ? 0 : res1;
    res2 = isNaN(res2) ? 0 : res2;

    //compute projected lost sales
    ans = res1 * res2;

    //display total
    $(‘#m1-RESULTS-proLostSalesText’).text(ans);
    }
    Thank you for all of the help. I have learned so much from the support you give. I’m almost finished my App but just get stuck on things that make sense when you explain it. I really appreciate all of the assistance.

    Celeste

    #327970

    @CelesteP,

    You’re setting the text for the total with the wrong snippet. Use .val(ans) instead .text(ans)

    #327985

    Octavio:

    Thanks again. That worked perfectly. I was trying to model my code after an example and kept the results as a text field like the example.

    Thanks again,

    Celeste

Viewing 3 posts - 1 through 3 (of 3 total)
Reply To: Text Field * Text Field = Text Want a Value here: CLOSED

You must be logged in to post in the forum log in