By default, jQuery UI Modal will focus on the first input field in modal mode.
If for some reason the first input field is not set, you can add the input autofocus attribute in the first input field:
<input type="text" name="date" value="" autofocus> <input type="text" name="phone" value="">
Or if you need a second or other input field instead of focus, apply the autofocus input attribute to the second input field:
<input type="text" name="date" value=""> <input type="text" name="phone" value="" autofocus>
:)
Jonathan marzullo
source share