facebook

javascript function clear text fields

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

    thefenex
    Member

    So I’m trying to clear lingering data from a series of text fields after sending data to the local storage…

    I tried this but couldn’t get it working… any ideas?

    function clearForm()
    {

    $(‘#m1-page_name-my_textfield’).val = “”;

    }

    then calling

    clearForm();

    on a button click for testing purposes

    thanks,
    Jesse

    #324421 Reply

    Albatros78
    Participant

    Hello,

    Your syntax is not correct.
    Try this one

    $(‘#m1-page_name-my_textfield’).val (”);

    Hope this helps

    #324477 Reply

    thefenex
    Member

    sweet… that syntax worked on the textfields… thanks for the tip!

    I tried this to clear a combobox

    $(‘select[name=”my_combobox”]’).val(”);

    and it didn’t work… is there a different syntax for comboboxes?

    #324523 Reply

    thefenex
    Member

    thanks for the reply…

    I wasn’t able to get this working… I tried it to clear a combo box and to bind data from the local storage to a combo box…

    but I will keep working with it… I could have made a mistake

    #324541 Reply

    support-michael
    Keymaster

    @thefenex

    See the javascript snippets for interacting with combobox widgets here. I updated with combo snippets for programmatically setting a combo’s selection.

Viewing 5 posts - 1 through 5 (of 5 total)
Reply To: javascript function clear text fields

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