Fix problema submit form di aggiunta rapida

This commit is contained in:
Thomas Zilio 2018-02-23 15:39:43 +01:00
parent c7b5bb094c
commit 3c166cbafb
2 changed files with 5 additions and 15 deletions

View File

@ -77,6 +77,9 @@ $(document).ready(function(){
$("#form_'.$id_module.'-'.$id_plugin.'").find("form").ajaxForm({
url: "'.$rootdir.$directory.'/actions.php",
beforeSubmit: function(arr, $form, options) {
return $form.parsley().validate();
},
data: data,
type: "post",
success: function(data){

View File

@ -10,13 +10,13 @@ if (get('tipoanagrafica') != '') {
}
echo '
<form action="editor.php?id_module=$id_module$" method="post" onsubmit="return add_anagrafica();">
<form action="editor.php?id_module=$id_module$" method="post">
<input type="hidden" name="op" value="add">
<input type="hidden" name="backto" value="record-edit">
<div class="row">
<div class="col-md-6">
{[ "type": "text", "label": "'.tr('Ragione sociale').'", "name": "ragione_sociale", "required": 1, "value": "" ]}
{[ "type": "text", "label": "'.tr('Ragione sociale').'", "name": "ragione_sociale", "required": 1 ]}
</div>
<div class="col-md-6">
@ -31,16 +31,3 @@ echo '
</div>
</div>
</form>';
?>
<script>
function add_anagrafica(){
if ( $('#ragione_sociale').val()==''){
alert( "Specifica una ragione sociale." );
return false;
}
else if( $('#idtipoanagrafica option:selected').length == 0 ){
alert( "Seleziona almeno un tipo di anagrafica." );
return false;
}
}
</script>