abigdreamer
Posts: 0
Joined: Fri Jul 12, 2013 7:20 pm

How do I clear out inputs after the user pushes send and the job has been sent?

I have inputs, they are bound to backend json fields. After pressing Send the screen should clear and allow the user to enter another record. How do I clear out all the entries on the screen for input fields once send is pushed.

maxkatz
Posts: 0
Joined: Fri Aug 13, 2010 3:24 pm

How do I clear out inputs after the user pushes send and the job has been sent?

When you click send, run JavaScript and set all inputs to "", for example.

abigdreamer
Posts: 0
Joined: Fri Jul 12, 2013 7:20 pm

How do I clear out inputs after the user pushes send and the job has been sent?

I have two problems.

  1. I don't know javascript

  2. I don't know how to reference the objects on the form.

    Please thrown me a bone. Point me somewhere to figure this out.
    I learn fast.

    Mike

abigdreamer
Posts: 0
Joined: Fri Jul 12, 2013 7:20 pm

How do I clear out inputs after the user pushes send and the job has been sent?

How about an action that ties to the form.

and then somethinking like

formname.clear
formname.getkey('keyname')
formname.deleterec('recno')

Yes I need to learn javascript and jquerymobile.

abigdreamer
Posts: 0
Joined: Fri Jul 12, 2013 7:20 pm

How do I clear out inputs after the user pushes send and the job has been sent?

ok, I found this...
http://stackoverflow.com/questions/72...

It has things like ...$('.all_fields').val(''); where .all_fields is a class.
$('#formID')[0].reset(); --- this but I don't know the form id ... looking
$('input').val(''); --- and then this.

Now I have to try them.

abigdreamer
Posts: 0
Joined: Fri Jul 12, 2013 7:20 pm

How do I clear out inputs after the user pushes send and the job has been sent?

$('.live_form').val('');
This worked. (YEH)
but now to figure out how to reference forms and objects

My form is called Liveinvoicepage1 -- my item is called item1descript
how do I reset it back to 'Towing' its a DROP down now.
A select

Ashton Stockman
Posts: 0
Joined: Wed Jul 17, 2013 9:49 pm

How do I clear out inputs after the user pushes send and the job has been sent?

You're looking for a jQuery selector by id. Something I've picked up working with this platform is that the id's of controls are always:

##page##_##control##

Where your page might be "homeScreen" and you're trying to select a button "buttonSubmit" for instance.

Using the above example, to reference the submit button directly, you'd use:

$("#homeScreen_buttonSubmit")

Your particular fix should be something like:

$("#Liveinvoicepage1_item1descript").val("Towing");

Let me know if that helps.

Maryna Brodina
Posts: 0
Joined: Thu Apr 05, 2012 7:27 am

How do I clear out inputs after the user pushes send and the job has been sent?

[quote:]$('input').val('')[/quote] means select all inputs and set property equal to empty line "". This method resets all inputs on all pages, not just the current one. It also resets all checkboxes and radiobuttons. It's better to do this way codeAppery("screenName").find("input[type=text]").val("");/code

[quote:]$('#formID')[0].reset()[/quote] if you create page inside the builder (not using HTML in panel) - there is no form on page, so you can't use this method

[quote:]$('.className').val('')[/quote] means select all elements with class all_fields and set property equal to empty line "". So in builder you can set className for inputs you need to reset and use this code

if item1descript is a select and you need to set any value try this code:
codeAppery("item1descript").val("Value");
Appery("item1descript").selectmenu('refresh');/code
where Value - value of item you set

Johnny
Posts: 0
Joined: Tue Jul 23, 2013 10:09 am

How do I clear out inputs after the user pushes send and the job has been sent?

Thank you for the code.

I needed it after logout and this works great :)
Appery("login").find("input[type=text]").val("");
Appery("login").find("input[type=password]").val("");

Return to “Issues”