37 lines
1.2 KiB
PHP
37 lines
1.2 KiB
PHP
<?php
|
|
|
|
$smarty->assign('error_field_1', $sf_request->getError('my_form{field_1}'));
|
|
|
|
$smarty->assign('input_field_1', input_tag('my_form[field_1]', $sf_params->get('my_form[field_1]'), array('id'=>'st_form-modal-field_1', 'placeholder'=>__('Example'), 'maxlength'=>'255', 'class'=>'form-control')));
|
|
|
|
$smarty->assign('my_form_data', $my_form_data);
|
|
|
|
|
|
$modal_tpl = 'modal_form_'.$modal.'.html';
|
|
|
|
$smarty->display($modal_tpl);
|
|
|
|
?>
|
|
|
|
<script type="text/javascript">
|
|
jQuery(function ($) {
|
|
$(document).ready(function() {
|
|
|
|
|
|
$( "#submit-form" ).click(function() {
|
|
postModal();
|
|
});
|
|
|
|
<?php $url = 'stModalFrontend/ModalForm'.ucfirst($modal); ?>
|
|
<?php $container_id = '#modal-form-container-'.$modal; ?>
|
|
|
|
function postModal()
|
|
{
|
|
$.post("<?php echo url_for($url) ?>", { 'modal' : '<?php echo $modal ?>', 'my_form[field_1]' : $('#st_form-modal-field_1').val() }, function(data) {
|
|
$('<?php echo $container_id; ?>').html(data);
|
|
});
|
|
}
|
|
|
|
});
|
|
});
|
|
</script>
|