Skip to content
Snippets Groups Projects
Commit b57e30bb authored by Benoit Alessandroni's avatar Benoit Alessandroni
Browse files

Adding check on fields content before proposing submission

parent 3ffcf8c6
No related branches found
No related tags found
1 merge request!138Fix router bug
Pipeline #5083 failed with stage
in 1 hour
...@@ -28,17 +28,17 @@ sib-form#mentor_profile_creation.block_log.block_creat_count( ...@@ -28,17 +28,17 @@ sib-form#mentor_profile_creation.block_log.block_creat_count(
widget-header_social_media="cs-section_header" widget-header_social_media="cs-section_header"
widget-header_about_you="cs-section_introduction" widget-header_about_you="cs-section_introduction"
label-first_name=`${data.Surname}` label-first_name=`${data.Surname} *`
label-last_name=`${data.Name}` label-last_name=`${data.Name} *`
label-mentorProfile.organisation=`${data.Organisation}` label-mentorProfile.organisation=`${data.Organisation} *`
label-mentorProfile.phone=`${data.PhoneNumber}` label-mentorProfile.phone=`${data.PhoneNumber}`
label-mentorProfile.languages=`${data.Language}` label-mentorProfile.languages=`${data.Language} *`
label-mentorProfile.fields=`${data.Field}` label-mentorProfile.fields=`${data.Field} *`
label-account.picture=`${data.Photo}` label-account.picture=`${data.Photo}`
label-mentorProfile.headline=`${data.Headline}` label-mentorProfile.headline=`${data.Headline}`
class-mentorProfile.headline="w_75" class-mentorProfile.headline="w_75"
label-mentorProfile.city=`${data.City}` label-mentorProfile.city=`${data.City} *`
label-mentorProfile.country=`${data.Country}` label-mentorProfile.country=`${data.Country} *`
label-mentorProfile.biography=`${data.ActivitiesMore}` label-mentorProfile.biography=`${data.ActivitiesMore}`
label-mentorProfile.skills=`${data.SkillForSearcher}` label-mentorProfile.skills=`${data.SkillForSearcher}`
label-mentorProfile.linkedin="Linkedin" label-mentorProfile.linkedin="Linkedin"
......
...@@ -26,7 +26,6 @@ sib-form#mentor_profile_edition.block_log.block_creat_count( ...@@ -26,7 +26,6 @@ sib-form#mentor_profile_edition.block_log.block_creat_count(
label-mentorProfile.phone=`${data.PhoneNumber}` label-mentorProfile.phone=`${data.PhoneNumber}`
label-mentorProfile.languages=`${data.Language}` label-mentorProfile.languages=`${data.Language}`
label-mentorProfile.fields=`${data.Field}` label-mentorProfile.fields=`${data.Field}`
label-account.picture=`${data.Photo}`
label-mentorProfile.headline=`${data.Headline}` label-mentorProfile.headline=`${data.Headline}`
class-mentorProfile.headline="w_75" class-mentorProfile.headline="w_75"
label-mentorProfile.city=`${data.City}` label-mentorProfile.city=`${data.City}`
...@@ -57,6 +56,7 @@ sib-form#mentor_profile_edition.block_log.block_creat_count( ...@@ -57,6 +56,7 @@ sib-form#mentor_profile_edition.block_log.block_creat_count(
upload-url-account.picture=`${sdn}upload/` upload-url-account.picture=`${sdn}upload/`
widget-account.picture='cs-form-profile-picture' widget-account.picture='cs-form-profile-picture'
class-account.picture='input_photo w_25' class-account.picture='input_photo w_25'
label-account.picture=`${data.Photo}`
class-headline='w_75' class-headline='w_75'
submit-button=`${data.SaveModification}` submit-button=`${data.SaveModification}`
......
...@@ -590,6 +590,28 @@ jQuery(document).ready(function($) { ...@@ -590,6 +590,28 @@ jQuery(document).ready(function($) {
}, 2000); }, 2000);
}); });
const mentorCreationForm = document.getElementById('mentor_profile_creation');
mentorCreationForm.addEventListener("populate", e => {
let submitInput = mentorCreationForm.querySelectorAll('input[type=submit]')[0];
submitInput.disabled = true;
submitInput.classList.add('disabled');
const textInputs = mentorCreationForm.querySelectorAll('input[type="text"]');
textInputs.forEach(function(text_input) {
text_input.addEventListener('focusout', (() => {
if (mentorCreationForm.querySelectorAll('input[name="first_name"]')[0].value != "" &&
mentorCreationForm.querySelectorAll('input[name="last_name"]')[0].value != "" &&
mentorCreationForm.querySelectorAll('input[name="mentorProfile.city"]')[0].value != "" &&
mentorCreationForm.querySelectorAll('select[name="mentorProfile.languages"]')[0].value != "" &&
mentorCreationForm.querySelectorAll('select[name="mentorProfile.fields"]')[0].value != "" &&
mentorCreationForm.querySelectorAll('select[name="mentorProfile.country"]')[0].value != "") {
let submitInput = mentorCreationForm.querySelectorAll('input[type=submit]')[0];
submitInput.disabled = false;
submitInput.classList.remove('disabled');
}
}));
});
});
//Set the share links //Set the share links
$(".twitter-link").on("populate", function (e) { $(".twitter-link").on("populate", function (e) {
var regexContributor = /mentor/g var regexContributor = /mentor/g
......
...@@ -227,6 +227,11 @@ body{ ...@@ -227,6 +227,11 @@ body{
box-shadow: none; box-shadow: none;
} }
input[type="submit"].disabled {
pointer-events: none;
opacity: .35;
}
.button_base, input[type="submit"], #mentor-resource-detail a, #entrepreneur-resource-detail a, .button_base, input[type="submit"], #mentor-resource-detail a, #entrepreneur-resource-detail a,
#mentor-resource-validate a, .sib-conversation form input[type="submit"], #mentor-resource-validate a, .sib-conversation form input[type="submit"],
#public-resource-detail a, #mentor-database-resource-detail a{ #public-resource-detail a, #mentor-database-resource-detail a{
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment