facebook

Switching the Text in a Textbox : CLOSED

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

    liortulip
    Member

    Hello. I am extremely new to Javascript, and I was wondering if anyone could give me the syntax needed to copy the text from one textbox to another, upon the click of a button.

    Thanks!

    #347937 Reply

    Code_A
    Member

    Here is one way you could do it using the id’s of the textfields:

    var data = $('[id$=textField1]').val();  //get data from first textfield
    $('[id$=textField2]').val(data); //place data in second textfield

    This is how you can do it by explicitly defining by the fields on the screens:

    var data = $('#m1-<screen_name>-textField1').val();  //get data from first textfield
    $('#m1-<screen_name>-textField2').val(data); //place data in second textfield

    You would place this code in the Run Javascript box of the On Click event for the button. I uploaded the file showing the example.

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

    liortulip
    Member

    Thanks so much for your help! That worked perfectly.

Viewing 3 posts - 1 through 3 (of 3 total)
Reply To: Switching the Text in a Textbox : CLOSED

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