For help with installation, bugs reports or feature requests, please head over to our new forums.
Genuitec Community on GitHub
- This topic has 13 replies, 3 voices, and was last updated 13 years, 10 months ago by
support-michael.
-
AuthorPosts
-
newappMemberHi
I am new to making appsI know some programming but nothing fancy.
I am trying to make a very simply app, is just a fake screen that pretends to dial someone.
This is what I have done so far:

What i would like to do is to put an INPUT screen on the top (circled in red) where if someone pushed the number 1 button it would be displayed on.
If someone could give me some help, I would really appreciate it !
thanks
NL
September 17, 2012 at 11:07 am #330222
support-octavioMemberHi,
I have not forgotten you 🙂 Things have been a little overwhelmed lately. I’ll follow up with you later today with a few advices.
September 18, 2012 at 7:57 am #330258
newappMemberThanks a lot !
I appreciate it.
Ok I will wait 🙂Thanks
NL
September 18, 2012 at 8:15 pm #330275
support-octavioMemberHi,
I will need one day more to check a few things with dev team and give you the best advice 🙂
September 19, 2012 at 6:58 am #330284
newappMemberOk
Thanks for not forgetting 🙂NL
September 19, 2012 at 7:09 pm #330307
support-octavioMemberHi
You can create a function like next one:
addDigit(num) { var inputField = $('#m1-AppName-text1'); $(inputField).val(inputField.val() + num); }Then set the on click action for each button:
Button1: addDigit(“1”)
Button2: addDigit(“2”)
Button3: addDigit(“3”)
…
Button9: addDigit(“9”)Don’t foget to add the Text Field widget ( inputField) where the numbers will be added.
Let us know how it goes.
September 19, 2012 at 8:47 pm #330309
newappMemberSo,
here is what I did :I added a text field which id is: textField1
The name of the app is : appThen on the Actions option of the text field I selected On Change Run Java Script you gave me, I just adapted it according with the id of the textField and the name of the app
And I placed this code as the java script:
addDigit(num) {
var inputField = $(‘#m1-App-textField1’);
$(inputField).val(inputField.val() + num);
}You can see it better in this picture:

I also made sure to put the script on Click on each one of the numbers (0 to 9) like:
addDigit(“1”)
addDigit(“2”)
etcHere is the picture about that:

That is what I have done, but it does not work. What am I doing wrong.
Thanks in advance for your help
NL
September 20, 2012 at 8:49 am #330323
support-octavioMemberHi,
Your function should be in your custom.js file. Please try it and let us know how it goes.
September 20, 2012 at 1:44 pm #330331
newappMemberI created a JS file and placed it in the folder, but nope 🙁
it did not workNL
September 20, 2012 at 2:33 pm #330333
support-octavioMemberHi,
Could you attach your custom.js file to review it and see what is wrong?
September 21, 2012 at 8:43 am #330361
newappMemberI have attached all the files
thanks a lot by the way for your support and helpNL
Attachments:
You must be logged in to view attached files.September 21, 2012 at 10:14 am #330363
support-michaelKeymasterNotice in your project there is a file www/app_custom.js. This file was generated by MobiOne and is intended where you add your custom javascript code. The file is named with the pattern <project-name>_custom.js. You can find more details here:
http://www.genuitec.com/mobile/docs/workingWithGeneratedFiles/workingWithGeneratedFiles.html#editing_javascriptSeptember 21, 2012 at 11:56 am #330366
newappMemberok
I just did that
but
ehmm
🙁
Nope 🙁
It still doesn’t workNL
September 21, 2012 at 1:13 pm #330367
support-michaelKeymasterSo investigated the code you sent and the addDigit() function had a couple of errors. Here is the version I implemented and tested. The function uses jquery extensively and I added it in the app_custom.js file.
function addDigit(num) { var textField1 = $('[name=textField1]'); $(textField1).val(textField1.val() + num); } -
AuthorPosts
