Jquery Modal Dialog with Jquery DatePicker field strange behavior

Hi people.

I need your help here, please.

I have a rails 3.0.9 app, and I'm using Ajax to save some records to
the database. To achieve this, I use a jquery modal form, but one of
the fields is a datepicker, and if I click on it to display the
calendar it doesn't work.

The thing is, I press submit without fill all the fields, so, my
custom validations were shown, telling me that I must fill some
fields, and when I did that... surprise... the date picker worked just
fine... I don't know why when I first load the dialog modal form
datepicker doesn't work, but when I "made a mistake" it works.

Can you help me? please

Hi people.

I need your help here, please.

I have a rails 3.0.9 app, and I'm using Ajax to save some records to
the database. To achieve this, I use a jquery modal form, but one of
the fields is a datepicker, and if I click on it to display the
calendar it doesn't work.

The thing is, I press submit without fill all the fields, so, my
custom validations were shown, telling me that I must fill some
fields, and when I did that... surprise... the date picker worked just
fine... I don't know why when I first load the dialog modal form
datepicker doesn't work, but when I "made a mistake" it works.

Can you help me? please

I've checked firebug, there's no difference (actually, firebug doesn't
show anything)
thanks for your help