JSFiddle - React, Tailwind, and code Playground
HTML
<input class="requesty" id="3" name="Санаторий Аврора" type="button" value="наличие мест" />
<div id="dialog" style="display:none">
<h3>Запрос на e-mail</h3>
<form action="http://igrushkivdom.ru/" name="request" method="post">
<div>
<label>Дата заезда</label><input class="ahtung" id="request_datepicker" name="request[date_begin]" type="text" readonly="readonly" value="" />
</div>
<div>
<label>Кол-во дней отдыха</label><input class="ahtung" name="request[days_count]" maxlength="3" type="text" value="" />
</div>
<div>
<label>Кол-во туристов</label>
<select class="ahtung" name="request[people_count]">
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
<option value="5">5</option>
<option value="6">6</option>
<option value="7">7</option>
<option value="8">8</option>
<option value="9">9</option>
<option value="10">10</option>
</select>
</div>
<table>
<tr>
<td>Примечания</td>
<td><textarea name="request[comments]"></textarea></td>
</tr>
</table>
<div>
<label>Ваши контакты</label>
<input class="ahtung" name="request[contacts]" maxlength="70" type="text" value="" />
</div>
<div>
<input id="obj_id" name="request[obj_id]" type="hidden" value="" />
<input name="request_submit" type="submit" value="Отправить запрос" />
</div>
</form>
</div>
CSS
#dialog form {padding:15px;}
#dialog form label {display:inline-block; width:150px;}
#dialog form input { padding:3px;}
#dialog form div { margin:10px 0;}
JavaScript
$(function()
{
$("#dialog").dialog(
{
autoOpen: false,
position: ['center', 'center'],
modal: true,
resizable: false,
width: 750,
hide: 'explode',
show: 'fold'
});
$(".requesty").click(function()
{
$('form[name=request]').submit(sendRequest);
$("#dialog #obj_id").val($(this).attr('id'));//alert(7);
$("#dialog").dialog("option", "title", 'Запрос цен и свободных мест для объекта - ' + $(this).attr('name'));
$("#dialog").dialog("open");
$('#request_datepicker').datepicker(
{
dateFormat: "yy-mm-dd",
minDate: 0
});
});
function sendRequest(e)
{
$('#dialog .ahtung').each(function()
{
if($(this).val() == '')
{
alert('Не заполнено обязательное поле "' + $(this).siblings('label').html()+ '"');
return false;
}
})
return false;
}
});