Good morning!
Personally, I'm a beginner in javascript and I have some questions about the following snippet:
var url;
function newUser(){
$('#dlg').dialog('open').dialog('setTitle','Novo Cliente');
$('#fm').form('clear');
url = 'salvar_cadastroclientes.php';
}
function saveUser(){
$('#fm').form('submit',{
url: url,
onSubmit: function(){
return $(this).form('validate');
},
success: function(result){
var result = eval('('+result+')');
if (result.success){
$('#dlg').dialog('close'); // close the dialog
$('#dg').datagrid('reload'); // reload the user data
} else {
$.messager.show({
title: 'Erro',
msg: result.msg
});
}
}
});
}
In the save function, the code is capturing submit
of form
.
And in the second line, what is this url: url
, onSubmit
...?