Question: I'm designing a page that is supposed to allow users to submit possible computing science projects and at one stage the user will have to enter a duration that the project will run over. To make things easier on the user the I'm trying to fill out the from: to: fields using jQuery's datepicker method however I cannot get the script to run when the user selects the appropriate field.

So far I've got the following script:

```
<h:outputScript library="jquery" name="jquery-1.9.1.js"/>
<h:outputScript library="jquery" name="jquery-ui-1.10.3.custom.js"/>
<h:outputScript library="jquery" name="jquery-ui-1.10.3.custom.min.js"/>

<h:head>
    <title>Add project</title>

    <script type="text/javascript" id="setDate">
        $(function() {
            $(" #datepicker ").datepicker();
        });
    </script>
    <!-- rest omitted for readability -->

```

and my h:inputText looks like this:

```
<h:inputText id="setDate" value="" onclick="$('#datepicker').datepicker();"/>
<p>Date: <input type="text" id="datepicker" /></p>

```

I did try to make it work without using any jsf tags and managed to get it up and running but I just can seem to make it work with jsf tags.

The problem is that when in a browser the jQuery datepicker widget does not display upon clicking on the field. Clicking on the field defined using the standard `<input>` tag works correctly.

Any help is greatly appreciated, thanks.

Answer: 
you can see the next [example](http://developer.android.com/guide/topics/ui/dialogs.html#CustomLayout).

**Creating a Custom Layout**

If you want a custom layout in a dialog, create a layout and add it to an AlertDialog by calling setView() on your AlertDialog.Builder object.

By default, the custom layout fills the dialog window, but you can still use AlertDialog.Builder methods to add buttons and a title.
As per your requirement u have to design custom dialog layout this layout contains one textview and 2 buttons which look as default alert dialog. and write listeners for two buttons and design buttons according to your requirement .