{* Smarty *}

{literal}
<script type="text/javascript">
//<![CDATA[

$(function() {
  AltButtons();
});

$(function() {
  $("#ping_number").spinner({
    "min": 1,
    "max": 10
  });
});
  
$(function() {
  $("input[name='ping_name']").css("width","300px");
  $("input[name='ping_number']").css("width","20px");
});

function showResponseFormPingAdd(responseText){
  DialogStandartOpen('PingResultFrm', responseText, 'Результат.');
}

$(function(){
  var options = {
    success: showResponseFormPingAdd,
    timeout: 36000
  };
  $("#FormPingAdd").validate({
    submitHandler: function(form) {
      $(form).ajaxSubmit(options);
    },
    rules : {
      "ping_name" : {
        required : true
      },
      "ping_number" : {
        required : true,
        number: true
      }
    },
    errorPlacement: function(error, element) {
      var er = element.attr("name");
      error.appendTo($("label[for='" + er + "']").next() );
    }
  });
});
//]]>
</script>
{/literal}

<form action="{$MS_SP->Sp_PathTop}{$MS_SP->Sp_PathToSite}/AjaxServer/PingGet.ajax.php" method="post" name="FormPingAdd" id="FormPingAdd">
  <table>
    <tr>
      <td><label for="ping_name">Адрес <span class="ui-state-error">* </span>:&nbsp;</label><span></span></td>
      <td><input type="text" id="ping_name" name="ping_name" value="" /></td>
    </tr>
    <tr>
      <td><label for="ping_number">Количество <span class="ui-state-error">* </span>:&nbsp;</label><span></span></td>
      <td><input id="ping_number" name="ping_number" value="3" /></td>
    </tr>
    <tr>
      <td colspan="2">
        <span class="ui-state-error"> * </span>поля обязательные для заполнения
      </td>
    </tr>
    <tr>
      <td colspan="2" class="MsFormSubmit"><input class="AltButtons" name="FormSubmit" value="Выполнить" type="submit" /></td>
    </tr>
  </table>
</form>