Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
Pixel Humain
survey
Commits
a029dac6
Commit
a029dac6
authored
Jun 25, 2020
by
Anatole Rakotoson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
modif multivalidation pour ajouter validation siret
parent
f25a246e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
10 deletions
+28
-10
views/tpls/forms/cplx/multitextvalidation.php
views/tpls/forms/cplx/multitextvalidation.php
+28
-10
No files found.
views/tpls/forms/cplx/multitextvalidation.php
View file @
a029dac6
...
...
@@ -168,7 +168,8 @@ $paramsData = [
"validation"
=>
[
"text"
=>
"texte"
,
"number"
=>
"Nombre"
,
"email"
=>
"adresse mail"
"email"
=>
"adresse mail"
,
"unique"
=>
"Siret"
]
];
...
...
@@ -296,13 +297,32 @@ if($mode == "r"){ ?>
$(this).parent().addClass('true-validate');
}
answer.path =
"
answers
.
"
+$(this).data(
"
form
"
)+
"
.
"
+$(this).data(
"
id
"
);
answer.collection =
"
answers
"
;
answer.id =
"
<?php
echo
$answer
[
"_id"
];
?>
"
;
answer.value = $(this).val();
dataHelper.path2Value(answer , function(params) {
//toastr.success('saved');
});
if($(this).attr('type') == 'unique' ) {
ajaxPost(null, baseUrl+
"
/
co2
/
search
/
globalautocomplete
"
, {
"
searchType
"
: [
"
organizations
"
],
"
filters
"
: {
"
siret
"
: [$(this).val()] }},
function (data){
if (data.results.lenght != 0){
toastr.error('cette organisation existe déjà');
} else {
answer.path =
"
answers
.
"
+$(this).data(
"
form
"
)+
"
.
"
+$(this).data(
"
id
"
);
answer.collection =
"
answers
"
;
answer.id =
"
<?php
echo
$answer
[
"_id"
];
?>
"
;
answer.value = $(this).val();
dataHelper.path2Value(answer , function(params) {
//toastr.success('saved');
});
}
}
);
} else {
answer.path =
"
answers
.
"
+$(this).data(
"
form
"
)+
"
.
"
+$(this).data(
"
id
"
);
answer.collection =
"
answers
"
;
answer.id =
"
<?php
echo
$answer
[
"_id"
];
?>
"
;
answer.value = $(this).val();
dataHelper.path2Value(answer , function(params) {
//toastr.success('saved');
});
}
}
})
});
...
...
@@ -338,8 +358,6 @@ if($mode == "r"){ ?>
$(thisAlert).removeClass('alert-validate');
}
</script>
<?php
}
?>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment