For help with installation, bugs reports or feature requests, please head over to our new forums.
Genuitec Community on GitHub
- This topic has 17 replies, 5 voices, and was last updated 12 years, 7 months ago by
vivek2013.
-
AuthorPosts
-
PBXhowTosMemberHey there,
I am new to MobiOne and I am trying to make a simple app but I am stuck at being able to do a certain function.
I have a button next to a text field and I want to populate the text field when I push the button with the current time.
any ideas how I can do this? I have tried many ways but have been unsuccessful.
thanks in advance!
CJOctober 18, 2012 at 5:00 pm #331460
support-octavioMemberHi CJ,
I posted a solution for a similar request here: http://www.genuitec.com/support-genuitec/viewtopic.php?p=6288#p6288
Hope it helps to you.
October 18, 2012 at 8:23 pm #331466
PBXhowTosMember@support-octavio wrote:
Hi CJ,
I posted a solution for a similar request here: http://www.genuitec.com/support-genuitec/viewtopic.php?p=6288#p6288
Hope it helps to you.
I saw this post but that did not help me.
I made a simple button, textfield app. When I click on the button, nothing gets populated into the textfield. do I need to do something to some other file for this to work?
October 19, 2012 at 4:50 am #331481
support-octavioMemberHi CJ,
Could you share the line of code that is not working for you to populate your text field? I suspect that is a syntax error.
October 19, 2012 at 8:01 am #331492
PBXhowTosMember@support-octavio wrote:
Hi CJ,
Could you share the line of code that is not working for you to populate your text field? I suspect that is a syntax error.
Here you go:
//update the text of the input field $('#m1-StatusUpdateApp-textField2').val('TIME NOW')October 19, 2012 at 1:55 pm #331498
support-octavioMemberHi CJ,
Please try with:
$('#m1-StatusUpdateApp-textField2').text('TIME NOW')Let me know how it goes.
October 19, 2012 at 2:12 pm #331500
PBXhowTosMember@support-octavio wrote:
Hi CJ,
Please try with:
$('#m1-StatusUpdateApp-textField2').text('TIME NOW')Let me know how it goes.
changed it to that and nothing happens. I click the button and the text field does not update.
October 19, 2012 at 3:41 pm #331502
support-octavioMemberQ: is this a secondary screen? Where are you adding this code? Do you have more than one <Design-name>_custom.js file?
October 19, 2012 at 5:16 pm #331508
PBXhowTosMember@support-octavio wrote:
Q: is this a secondary screen? Where are you adding this code? Do you have more than one <Design-name>_custom.js file?
To test, all I did was drop a text field and a button as soon as a new project is started. Then I added the code to the button on JavaScript action. That’s it.
October 19, 2012 at 5:26 pm #331510
PBXhowTosMemberHere is what I did exactly.
October 22, 2012 at 9:38 am #331542
support-michaelKeymasterPlease see this collection of snippets:
http://www.genuitec.com/mobile/docs/javaScriptSnippets/javaScriptSnippets.html#input_field_widget_snippetsOctober 22, 2012 at 9:48 am #331544
PBXhowTosMember@support-wayne wrote:
Please see this collection of snippets:
http://www.genuitec.com/mobile/docs/javaScriptSnippets/javaScriptSnippets.html#input_field_widget_snippetsI did. Hence where I got the code from and does not resolve the issue. Do I have to put the entire HTML code in the JavaScript box? did you see my video of how I added the button and text field?
thanks.
October 22, 2012 at 10:06 am #331546
support-michaelKeymasterTry either of the following snippets
//jquery selects the node by its id $('#m1-Untitled3-textField1').val(123)//jquery selects the node that ends with the string textField1 $('[id*=textField1]').val('123')October 22, 2012 at 10:14 am #331548
support-octavioMemberHi PBXhowTos,
I suspect that next line that you shared is OK, just the textField should be textField1, could you try again with this? @PBXhowTos wrote:
Here you go:
//update the text of the input field $('#m1-StatusUpdateApp-textField2').val('TIME NOW')$('#m1-StatusUpdateApp-textField1').val('TIME NOW');In case that the problem continues let me know to share a simple example.
October 22, 2012 at 12:45 pm #331557
PBXhowTosMember@support-wayne wrote:
Try either of the following snippets
//jquery selects the node by its id $('#m1-Untitled3-textField1').val(123)//jquery selects the node that ends with the string textField1 $('[id*=textField1]').val('123')Thank you!! That worked.
-
AuthorPosts
