Setup a clear function in a toolbar

I setup a form to get input data.

I will setup a function that it can clear up all data in the each field before save. It is back to initial screen.

This function I will use a botton in a toolbar.

I want to ask this method ?

  1. create a toolbar: … mlxtoolbar
  2. create form: … xform_init
  3. apply event handler to you toolbar button to clear the form:

toolbar.attachEvent("onClick", function(id){ if (id == "clear_form"){ myForm.clear(); } });


I can get the result !

Thanks for your help !


You are welcome!