facebook

Button to Text Field: 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 - 16 through 18 (of 18 total)
  • Author
    Posts
  • #341606

    vivek2013
    Member

    New to Mobione, trying the trial version, not a programmer but have some app idea to try out, so was looking at this tool.
    Stuck on this issue already raised by someone and now closed. But not sure whether to open new topic or post on this, so posting here.
    This is what I tried:
    Opened Design Center
    Created new SmartPhone Design->Basic Template
    saved this file as pg1.mobi
    – had checked the box Startup Screen
    Added widgets
    – Panel
    – Text Widget (ID=txtLabel)
    – Button(Push)
    Then chose
    – Onlclick of Button
    – Run JavaScript
    – Opened JavaScript Action Editor
    want to change the text shown in the Text widget
    Tried the solution given here, none working.
    $(‘#txtLabel’).val(‘test’)
    $(‘#txtLabel’).text(‘test’)
    $(‘#txtLabel’).val(‘test’);
    $(‘#txtLabel’).text(‘test’);

    None of the above is working and stuck and wondering whether this is really easy to use for a non-programmer like me!
    Please help.
    Thanks in advance.

    #341614

    Stu Wade
    Member

    You are falling foul of the somewhat arcane naming conventions used by this tool…

    what you need is:

    $(‘#m1-pg1-txtLabel’).text(‘new text here’);

    the schema is m1 – says this is MobiOne
    pg1 – the .mobi file you are addressing
    txtLabel – the widget ID you are addressing

    note that textFields take .val rather than .text used by labels

    By the bye – this is a closed thread – you should have opened a new one really, but I’m sure no-one will mind

    #341638

    vivek2013
    Member

    Hi Stu,
    It worked!
    Thanks a lot for quick help.
    I have another related to this only but as you said would open a new topic.
    Thanks again!

Viewing 3 posts - 16 through 18 (of 18 total)
Reply To: Button to Text Field: CLOSED

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