Datepicker and form_state with different formats I'm using custom form for getting results from a web service.

This is a part of my form

&lt;?php

$form['starting_date'] = array(
   '#type' =&gt; 'date_popup',
   '#title' =&gt; 'Starting date',   
   '#date_format' =&gt; 'd.m.Y',
)


As you can see I'm using the date_popup from the Date module. 

It's displaying correct with this format d.m.Y. but after submitting the form, I've got error from a web service, because the string I'm passing . form_state['values']['starting_date'] . on print, the values are with different format.

Lets say a user selects 10.02.2014 (today), the form_state displays as 2014-10-02.

How can I fix that? The web service has to receive only with this format d.m.Y to display the results, otherwise it doesn't work.
1.Add a js file to the module and 
2.In the js add the following code using the id of date field 
to change the date format of the date picker
3.check the link for reference

$( ".selector" ).datepicker({ dateFormat: "yy-mm-dd" });