jQuery UI - dialog and datepicker problem

jQuery UI - dialog and datepicker problem


i have an issue regrading dialog and datepicker usage.
first, i call the dialog box which contains form with several fields
to show. next, the $('.datepick').datepicker(dpOptions) is called to
attach the datepicker to the required fields (there are two).
the problem is when any of the fields is clicked, the datepicker only
shows UNDER the dialog and therefore is not visible. i thought it has
something to do with its z-index (datepicker's) but was not able to
fix it.
any suggestion or help is welcome.