bd 7.0
This commit is contained in:
@ -15,28 +15,19 @@ use itguild\forms\inputs\TextArea;
|
||||
])
|
||||
->setLabel("Название формы")
|
||||
->render();
|
||||
$form->field(TextArea::class, name: "params", params: [
|
||||
'class' => "form-control",
|
||||
'placeholder' => 'Параметры формы'
|
||||
])
|
||||
->setLabel("Параметры формы")
|
||||
->render();
|
||||
|
||||
|
||||
?>
|
||||
<button style="margin-top:15px" type="button" id="buttonAdd" class="btn btn-primary form-control" onclick="ajaxRequest()">Добавить поле</button>
|
||||
|
||||
|
||||
|
||||
<?php
|
||||
$form->field(\itguild\forms\inputs\Button::class, name: "btn-submit", params: [
|
||||
'class' => "btn btn-primary ",
|
||||
'value' => 'Отправить',
|
||||
'typeInput' => 'submit'
|
||||
])
|
||||
->render();
|
||||
$form->endForm();
|
||||
?>
|
||||
<script>
|
||||
$.ajax({
|
||||
url:'/handler.php',
|
||||
method: 'post',
|
||||
dataType: 'html'
|
||||
data: {element: 'value', abc:'test'},
|
||||
success: function (data){
|
||||
console.log(<<Sent successfully: >> + data);
|
||||
}
|
||||
});
|
||||
</script>
|
||||
<?php $form->endForm(); ?>
|
||||
|
Reference in New Issue
Block a user