How to remove form elements before submitting the form? All form items in Drupal must be created with Form API, otherwise form values in $form_state and in $_POST variables are empty after submitting the form. 

But sometimes I need to have in form some other items, not created with Form API.  For example  I want to use external jquery plugin like Pickadate (similar like datepicker). This js plugin adds some HTML form elements into  object. And many other js plugins creates their own form elements on client side.

But when I use these plugins, form sent empty values after submitting. So before submitting the form, I need to remove these custom elements from form. I don't need values from these elements, they just help to pick the value selected by user. 

Is there any workaround, some event, that can help me remove these elements right before submitting the form?
There are two ways, actually:


Wrap them into a proper modules. You will avoid conflict with Form API by cooperating with it. See Datepicker's code to get idea how to do it.
Create onsubmit javascript event and remove elements with jQuery.