facebook

Calculation

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

    flexart
    Participant

    Hi

    Is there a way to integrate a calculation system with the program?
    If not. Is the code open to use a developer to do it

    Thanks,

    Edwin

    #314193 Reply

    support-michael
    Keymaster

    Edwin,

    Can you expand a little bit more on what you mean by “calculation system”? For example if you need to invoke custom logic in your app this is very doable assuming your logic can be called from a JavaScript function.

    Wayne
    Genuitec Mobile Team

    #314206 Reply

    flexart
    Participant

    Hi Wayne

    The calculation is very simple.
    Wide X Depth X Thickness = Total
    10 X 20 X 0.5 = 100
    See attachment

    When will scrolling in text available?

    Thanks,

    Edwin

    Attachments:
    You must be logged in to view attached files.
    #314254 Reply

    Molx
    Member

    You can do it just like Wayne said, with javascript.

    Create your input text fields and name them accordingly. Do the same for the output field.
    Go to your <project>_custom.js and create a function that loads the input texts into variables with getElementByID()
    Do whatever calculations you want with your inputs, and them assign the result to the output field using getElementByID() aswell.
    Finally, you will need a button to call your function, create it and link it to javascript:calculate().

    I’ll try to create an example for you and post here.

    -Edit-

    Here we go, you can play around with onChanged listener, max chars for inputs, etc.

    Attachments:
    You must be logged in to view attached files.
    #314261 Reply

    flexart
    Participant

    Update

    I exported and uploaded the files to the server and checked it on my iphone, but the calculation is not working online.
    I can fill in the fields, but when i click calculate it is not doing anything.

    See link:
    http://flexhost.com.au/test/calc

    Hi Molx

    Thank you so much for doing that! Much appreciated.
    It is exactly the way what i needed.

    Thanks again,

    Edwin

    #314265 Reply

    Molx
    Member

    @flexart wrote:

    I exported and uploaded the files to the server and checked it on my iphone, but the calculation is not working online.
    I can fill in the fields, but when i click calculate it is not doing anything.

    You changed the filename somewhere to index.html, and MB1 changed the calc_custom.js to index_custom.js in the html code. If you check for the original calc_custom.js, it’s there (but looks like a standard custom.s file, not sure why).

    Just make sure you have the correct _custom.js file uploaded and referenced to!

    See ya =)

    #314310 Reply

    flexart
    Participant

    Hi

    Yes, you are right. It is working now.

    Thanks for your help!

    Cheers,

    Edwin

Viewing 7 posts - 1 through 7 (of 7 total)
Reply To: Calculation

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