transformed select multiple in checkbox groups
This commit is contained in:
parent
e350ee9153
commit
8f16a1daba
|
@ -10,7 +10,6 @@
|
||||||
<wb-resource deploy-path="/" source-path="/src/main/webapp" tag="defaultRootSource"/>
|
<wb-resource deploy-path="/" source-path="/src/main/webapp" tag="defaultRootSource"/>
|
||||||
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/java"/>
|
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/java"/>
|
||||||
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/resources"/>
|
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/resources"/>
|
||||||
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/test/java"/>
|
|
||||||
<dependent-module archiveName="email-templates-library-1.5.0.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/email-templates-library/email-templates-library">
|
<dependent-module archiveName="email-templates-library-1.5.0.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/email-templates-library/email-templates-library">
|
||||||
<dependency-type>uses</dependency-type>
|
<dependency-type>uses</dependency-type>
|
||||||
</dependent-module>
|
</dependent-module>
|
||||||
|
|
|
@ -20,6 +20,7 @@ import javax.mail.internet.MimeMessage;
|
||||||
import javax.portlet.ActionRequest;
|
import javax.portlet.ActionRequest;
|
||||||
import javax.portlet.ActionResponse;
|
import javax.portlet.ActionResponse;
|
||||||
import javax.portlet.PortletException;
|
import javax.portlet.PortletException;
|
||||||
|
import javax.portlet.PortletSession;
|
||||||
import javax.portlet.RenderRequest;
|
import javax.portlet.RenderRequest;
|
||||||
import javax.portlet.RenderResponse;
|
import javax.portlet.RenderResponse;
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
@ -36,6 +37,7 @@ import com.liferay.portal.kernel.exception.SystemException;
|
||||||
import com.liferay.portal.kernel.log.LogFactoryUtil;
|
import com.liferay.portal.kernel.log.LogFactoryUtil;
|
||||||
import com.liferay.portal.kernel.util.GetterUtil;
|
import com.liferay.portal.kernel.util.GetterUtil;
|
||||||
import com.liferay.portal.kernel.util.StringPool;
|
import com.liferay.portal.kernel.util.StringPool;
|
||||||
|
import com.liferay.portal.kernel.util.StringUtil;
|
||||||
import com.liferay.portal.service.GroupLocalServiceUtil;
|
import com.liferay.portal.service.GroupLocalServiceUtil;
|
||||||
import com.liferay.portal.util.PortalUtil;
|
import com.liferay.portal.util.PortalUtil;
|
||||||
import com.liferay.util.bridges.mvc.MVCPortlet;
|
import com.liferay.util.bridges.mvc.MVCPortlet;
|
||||||
|
@ -80,6 +82,7 @@ public class CompileForm extends MVCPortlet {
|
||||||
renderRequest.setAttribute("main_motivations", main_motivations);
|
renderRequest.setAttribute("main_motivations", main_motivations);
|
||||||
renderRequest.setAttribute("areas_of_expertise", areas_of_expertise);
|
renderRequest.setAttribute("areas_of_expertise", areas_of_expertise);
|
||||||
renderRequest.setAttribute("degrees_of_participation", degrees_of_participation);
|
renderRequest.setAttribute("degrees_of_participation", degrees_of_participation);
|
||||||
|
|
||||||
super.render(renderRequest, renderResponse);
|
super.render(renderRequest, renderResponse);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
_log.error("Something wrong with Databaseconnection or with queries while getting combo types", e);
|
_log.error("Something wrong with Databaseconnection or with queries while getting combo types", e);
|
||||||
|
@ -93,19 +96,13 @@ public class CompileForm extends MVCPortlet {
|
||||||
String organisation = actionRequest.getParameter("organisation");
|
String organisation = actionRequest.getParameter("organisation");
|
||||||
String organisationType = actionRequest.getParameter("organisationType");
|
String organisationType = actionRequest.getParameter("organisationType");
|
||||||
String emailAddress = actionRequest.getParameter("emailAddress");
|
String emailAddress = actionRequest.getParameter("emailAddress");
|
||||||
String[] itemsAreaOfExpertiseSelectValues = actionRequest.getParameterValues("areaOfExpertiseSelect");
|
|
||||||
String areaOfExpertise = "";
|
|
||||||
for (int i = 0; i < itemsAreaOfExpertiseSelectValues.length; i++) {
|
|
||||||
areaOfExpertise += itemsAreaOfExpertiseSelectValues[i];
|
|
||||||
areaOfExpertise += "; ";
|
|
||||||
}
|
|
||||||
String country = actionRequest.getParameter("country");
|
String country = actionRequest.getParameter("country");
|
||||||
String participatedInActivitiesString = (String) actionRequest.getParameter("participatedInActivities");
|
String participatedInActivitiesString = (String) actionRequest.getParameter("participatedInActivities");
|
||||||
boolean participatedInActivities = Boolean.parseBoolean(participatedInActivitiesString);
|
boolean participatedInActivities = Boolean.parseBoolean(participatedInActivitiesString);
|
||||||
String mainMotivation = actionRequest.getParameter("mainMotivation");
|
|
||||||
String textareaMotivation = actionRequest.getParameter("textareaMotivation");
|
String textareaMotivation = actionRequest.getParameter("textareaMotivation");
|
||||||
String elaborated_expertise = actionRequest.getParameter("textareaExperience");
|
String elaborated_expertise = actionRequest.getParameter("textareaExperience");
|
||||||
String degree_of_participation = actionRequest.getParameter("commitment");
|
|
||||||
|
|
||||||
_log.debug("name:" + name);
|
_log.debug("name:" + name);
|
||||||
_log.debug("surname:" + surname);
|
_log.debug("surname:" + surname);
|
||||||
|
@ -114,87 +111,128 @@ public class CompileForm extends MVCPortlet {
|
||||||
_log.debug("email:" + emailAddress);
|
_log.debug("email:" + emailAddress);
|
||||||
_log.debug("country:" + country);
|
_log.debug("country:" + country);
|
||||||
_log.debug("participatedInActivities:" + participatedInActivities);
|
_log.debug("participatedInActivities:" + participatedInActivities);
|
||||||
_log.debug("mainMotivation:" + mainMotivation);
|
|
||||||
_log.debug("textareaMotivation:\n" + textareaMotivation+"\n");
|
_log.debug("textareaMotivation:\n" + textareaMotivation+"\n");
|
||||||
_log.debug("itemsAreaOfExpertise (Multi):\n");
|
_log.info("itemsAreaOfExpertise (Multi):\n");
|
||||||
for (int i = 0; i < itemsAreaOfExpertiseSelectValues.length; i++) {
|
|
||||||
_log.debug(itemsAreaOfExpertiseSelectValues[i]);
|
Connection conn;
|
||||||
}
|
|
||||||
_log.debug("textareaExperience:\n" + elaborated_expertise+"\n");
|
|
||||||
_log.debug("degrees_of_participation: "+ degree_of_participation);
|
|
||||||
_log.info("Got form compiled, inserting in DB.");
|
|
||||||
try {
|
try {
|
||||||
Connection conn = DatabaseConnection.getInstance("/"+PortalContext.getConfiguration().getInfrastructureName()).getConnection();
|
conn = DatabaseConnection.getInstance("/"+PortalContext.getConfiguration().getInfrastructureName()).getConnection();
|
||||||
String insertTableSQL = "INSERT INTO forms(name, surname, organisation, organisation_type, email, "
|
|
||||||
+ "country, activities_participation, main_motivation, elaborated_motivation, area_of_expertise, "
|
String[] mainMotivationValues = actionRequest.getParameterValues("mainMotivation");
|
||||||
+ "elaborated_expertise, degree_of_participation, data_management, datecreated, processed_form, user_accepted) "
|
List<String> list = getMainMotivations(conn);
|
||||||
+ "VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,current_timestamp,?,?)";
|
String[] main_motivations = list.toArray(new String[0]);
|
||||||
|
String mainMotivation = "";
|
||||||
|
|
||||||
|
for (int i = 0; i < mainMotivationValues.length; i++) {
|
||||||
|
System.out.println(i+"mainMotivationValues[i]="+mainMotivationValues[i]);
|
||||||
|
boolean valueTrue = Boolean.parseBoolean(mainMotivationValues[i]);
|
||||||
|
if (valueTrue)
|
||||||
|
mainMotivation += main_motivations[i-1]+"; "; //0 is a placeholder always false
|
||||||
|
}
|
||||||
|
|
||||||
|
System.out.println("mainMotivation="+mainMotivation);
|
||||||
|
|
||||||
|
String[] itemsAreaOfExpertiseSelectValues = actionRequest.getParameterValues("areaOfExpertiseSelect");
|
||||||
|
list = getAreasOfExpertise(conn);
|
||||||
|
String[] areas_of_expertise = list.toArray(new String[0]);
|
||||||
|
String areaOfExpertise = "";
|
||||||
|
|
||||||
|
for (int i = 0; i < itemsAreaOfExpertiseSelectValues.length; i++) {
|
||||||
|
boolean valueTrue = Boolean.parseBoolean(itemsAreaOfExpertiseSelectValues[i]);
|
||||||
|
if (valueTrue)
|
||||||
|
areaOfExpertise += areas_of_expertise[i-1]+"; ";
|
||||||
|
}
|
||||||
|
|
||||||
|
System.out.println("areaOfExpertise="+areaOfExpertise);
|
||||||
|
|
||||||
|
String[] degree_of_participationValues = actionRequest.getParameterValues("commitment");
|
||||||
|
list = getDgreesOfParticipation(conn);
|
||||||
|
String[] degrees_of_participation = list.toArray(new String[0]);
|
||||||
|
String degree_of_participation = "";
|
||||||
|
|
||||||
|
for (int i = 0; i < degree_of_participationValues.length; i++) {
|
||||||
|
boolean valueTrue = Boolean.parseBoolean(degree_of_participationValues[i]);
|
||||||
|
if (valueTrue)
|
||||||
|
degree_of_participation += degrees_of_participation[i-1]+"; "; //0 is a placeholder always false
|
||||||
|
}
|
||||||
|
|
||||||
|
System.out.println("degree_of_participation="+degree_of_participation);
|
||||||
|
|
||||||
|
|
||||||
|
_log.debug("textareaExperience:\n" + elaborated_expertise+"\n");
|
||||||
|
|
||||||
PreparedStatement preparedStatement = conn.prepareStatement(insertTableSQL);
|
_log.info("Got form compiled, inserting in DB.");
|
||||||
preparedStatement.setString(1, name);
|
|
||||||
preparedStatement.setString(2, surname);
|
// String insertTableSQL = "INSERT INTO forms(name, surname, organisation, organisation_type, email, "
|
||||||
preparedStatement.setString(3, organisation);
|
// + "country, activities_participation, main_motivation, elaborated_motivation, area_of_expertise, "
|
||||||
preparedStatement.setString(4, organisationType);
|
// + "elaborated_expertise, degree_of_participation, data_management, datecreated, processed_form, user_accepted) "
|
||||||
preparedStatement.setString(5, emailAddress);
|
// + "VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,current_timestamp,?,?)";
|
||||||
preparedStatement.setString(6, country);
|
//
|
||||||
preparedStatement.setBoolean(7, participatedInActivities);
|
// PreparedStatement preparedStatement = conn.prepareStatement(insertTableSQL);
|
||||||
preparedStatement.setString(8, mainMotivation);
|
// preparedStatement.setString(1, name);
|
||||||
preparedStatement.setString(9, textareaMotivation);
|
// preparedStatement.setString(2, surname);
|
||||||
preparedStatement.setString(10, areaOfExpertise);
|
// preparedStatement.setString(3, organisation);
|
||||||
preparedStatement.setString(11, elaborated_expertise);
|
// preparedStatement.setString(4, organisationType);
|
||||||
preparedStatement.setString(12, degree_of_participation);
|
// preparedStatement.setString(5, emailAddress);
|
||||||
preparedStatement.setBoolean(13, true); //data_management
|
// preparedStatement.setString(6, country);
|
||||||
preparedStatement.setBoolean(14, false); //processed_form
|
// preparedStatement.setBoolean(7, participatedInActivities);
|
||||||
preparedStatement.setBoolean(15, false); //user_accepted
|
// preparedStatement.setString(8, mainMotivation);
|
||||||
// execute insert SQL stetement
|
// preparedStatement.setString(9, textareaMotivation);
|
||||||
preparedStatement .executeUpdate();
|
// preparedStatement.setString(10, areaOfExpertise);
|
||||||
_log.info("Inserting in DB done, sending confirmation to user and notification to managers via email");
|
// preparedStatement.setString(11, elaborated_expertise);
|
||||||
|
// preparedStatement.setString(12, degree_of_participation);
|
||||||
String copySubmitted = new StringBuffer("\n\n\nCOPY OF INFORMATION SUBMITTED\n\n")
|
// preparedStatement.setBoolean(13, true); //data_management
|
||||||
.append("\n").append("Name: ")
|
// preparedStatement.setBoolean(14, false); //processed_form
|
||||||
.append(name).append(" ").append(surname)
|
// preparedStatement.setBoolean(15, false); //user_accepted
|
||||||
.append("\n").append("Organisation: ")
|
// // execute insert SQL stetement
|
||||||
.append(organisation)
|
// preparedStatement .executeUpdate();
|
||||||
.append("\n").append("Organisation type: ")
|
// _log.info("Inserting in DB done, sending confirmation to user and notification to managers via email");
|
||||||
.append(organisationType)
|
//
|
||||||
.append("\n").append("emailAddress: ")
|
// String copySubmitted = new StringBuffer("\n\n\nCOPY OF INFORMATION SUBMITTED\n\n")
|
||||||
.append("*** hidden on purpose ***")
|
// .append("\n").append("Name: ")
|
||||||
.append("\n").append("Country: ")
|
// .append(name).append(" ").append(surname)
|
||||||
.append(country)
|
// .append("\n").append("Organisation: ")
|
||||||
.append("\n\n").append("Have you participated in the activities of any of our MOVING Regional Multi-Actors Platforms? ")
|
// .append(organisation)
|
||||||
.append(participatedInActivities)
|
// .append("\n").append("Organisation type: ")
|
||||||
.append("\n\n").append("What is your main motivation for joining the EU MAP of MOVING? ")
|
// .append(organisationType)
|
||||||
.append(mainMotivation)
|
// .append("\n").append("emailAddress: ")
|
||||||
.append("\n\n").append("Please elaborate on your motivation expressed above so that we understand better your interest, and form a dynamic and relevant community. Vague explanations of the motivation might not be taken into consideration. ")
|
// .append("*** hidden on purpose ***")
|
||||||
.append("\n\n").append(textareaMotivation).append("\n")
|
// .append("\n").append("Country: ")
|
||||||
.append("\n\n").append("What is your main area of expertise in relation to mountain sustainability and resilience? (Multiple choice): ")
|
// .append(country)
|
||||||
.append(areaOfExpertise)
|
// .append("\n\n").append("Have you participated in the activities of any of our MOVING Regional Multi-Actors Platforms? ")
|
||||||
.append("\n\n").append("Please elaborate on the relevant experience you can bring to mountain value chains and the resilience of these areas, so that we have more detailed information to be able to form a dynamic and relevant community: ")
|
// .append(participatedInActivities)
|
||||||
.append("\n\n").append(elaborated_expertise)
|
// .append("\n\n").append("What is your main motivation for joining the EU MAP of MOVING? ")
|
||||||
.append("\n\n").append("As a starting point, the degree of participation you commit to is: ")
|
// .append(mainMotivation)
|
||||||
.append(degree_of_participation)
|
// .append("\n\n").append("Please elaborate on your motivation expressed above so that we understand better your interest, and form a dynamic and relevant community. Vague explanations of the motivation might not be taken into consideration. ")
|
||||||
.append("\n").append("\n").append("Data Management: ")
|
// .append("\n\n").append(textareaMotivation).append("\n")
|
||||||
.append("Agreed")
|
// .append("\n\n").append("What is your main area of expertise in relation to mountain sustainability and resilience? (Multiple choice): ")
|
||||||
.append("\n\nEND COPY OF INFORMATION SUBMITTED\n\n").toString();
|
// .append(areaOfExpertise)
|
||||||
|
// .append("\n\n").append("Please elaborate on the relevant experience you can bring to mountain value chains and the resilience of these areas, so that we have more detailed information to be able to form a dynamic and relevant community: ")
|
||||||
|
// .append("\n\n").append(elaborated_expertise)
|
||||||
Properties props = System.getProperties();
|
// .append("\n\n").append("As a starting point, the degree of participation you commit to is: ")
|
||||||
Session session = null;
|
// .append(degree_of_participation)
|
||||||
props.put("mail.smtp.host", mailServiceHost);
|
// .append("\n").append("\n").append("Data Management: ")
|
||||||
props.put("mail.smtp.port", mailServicePort);
|
// .append("Agreed")
|
||||||
//use localhost (probaly postfix instance)
|
// .append("\n\nEND COPY OF INFORMATION SUBMITTED\n\n").toString();
|
||||||
session = Session.getDefaultInstance(props);
|
//
|
||||||
|
//
|
||||||
sendEmailConfirmationToUser(props, session, emailAddress, copySubmitted);
|
// Properties props = System.getProperties();
|
||||||
|
// Session session = null;
|
||||||
String groupIdVREforManagers = GetterUtil.getString(actionRequest.getPreferences().getValue("VREGroupId", StringPool.BLANK));
|
// props.put("mail.smtp.host", mailServiceHost);
|
||||||
if (groupIdVREforManagers != null && groupIdVREforManagers.compareTo("") != 0) {
|
// props.put("mail.smtp.port", mailServicePort);
|
||||||
HttpServletRequest httpRequest = PortalUtil.getHttpServletRequest(actionRequest);
|
// //use localhost (probaly postfix instance)
|
||||||
sendEmailNotificationToVREManagers(httpRequest, props, session, groupIdVREforManagers, copySubmitted);
|
// session = Session.getDefaultInstance(props);
|
||||||
}
|
//
|
||||||
else {
|
// sendEmailConfirmationToUser(props, session, emailAddress, copySubmitted);
|
||||||
_log.warn("WARNING, non config found for groupId, no email will be send to VRE Managers");
|
//
|
||||||
}
|
// String groupIdVREforManagers = GetterUtil.getString(actionRequest.getPreferences().getValue("VREGroupId", StringPool.BLANK));
|
||||||
|
// if (groupIdVREforManagers != null && groupIdVREforManagers.compareTo("") != 0) {
|
||||||
|
// HttpServletRequest httpRequest = PortalUtil.getHttpServletRequest(actionRequest);
|
||||||
|
// sendEmailNotificationToVREManagers(httpRequest, props, session, groupIdVREforManagers, copySubmitted);
|
||||||
|
// }
|
||||||
|
// else {
|
||||||
|
// _log.warn("WARNING, non config found for groupId, no email will be send to VRE Managers");
|
||||||
|
// }
|
||||||
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
_log.error("Some error while trying to insert form");
|
_log.error("Some error while trying to insert form");
|
||||||
|
|
|
@ -3,10 +3,14 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
#wrapper .form-inline .checkbox input[type=checkbox] {
|
#wrapper .form-inline .checkbox input[type=checkbox] {
|
||||||
margin-right: 10px;
|
margin: 0 25px;
|
||||||
height: 18px;
|
height: 18px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.aui .control-group {
|
||||||
|
margin-bottom: 0 !important;
|
||||||
|
}
|
||||||
|
|
||||||
#wrapper label {
|
#wrapper label {
|
||||||
min-width: 200px;
|
min-width: 200px;
|
||||||
}
|
}
|
||||||
|
@ -23,10 +27,23 @@
|
||||||
font-family: "Open Sans", Arial, sans-serif !important;
|
font-family: "Open Sans", Arial, sans-serif !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#wrapper label.checkbox {
|
||||||
|
margin-bottom: 0;
|
||||||
|
margin-top: 5px;
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
.form-display {
|
.form-display {
|
||||||
margin: 10px 100px;
|
margin: 10px 100px;
|
||||||
border: 1px solid #CCC;
|
border: 1px solid #CCC;
|
||||||
font-size: 16px;
|
font-size: 16px;
|
||||||
line-height: 1.5;
|
line-height: 1.5;
|
||||||
font-family: "Open Sans", Arial, sans-serif !important;
|
font-family: "Open Sans", Arial, sans-serif !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
div.form-validator-stack.help-inline {
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
|
||||||
|
.first-checkbox-hidden {
|
||||||
|
display: none;
|
||||||
}
|
}
|
|
@ -13,7 +13,7 @@ pageContext.setAttribute("main_motivations", main_motivations);
|
||||||
pageContext.setAttribute("areas_of_expertise", areas_of_expertise);
|
pageContext.setAttribute("areas_of_expertise", areas_of_expertise);
|
||||||
pageContext.setAttribute("degrees_of_participation", degrees_of_participation);
|
pageContext.setAttribute("degrees_of_participation", degrees_of_participation);
|
||||||
|
|
||||||
pageContext.setAttribute("required", "true");
|
pageContext.setAttribute("required", "false");
|
||||||
%>
|
%>
|
||||||
<portlet:defineObjects />
|
<portlet:defineObjects />
|
||||||
<script src="https://www.google.com/recaptcha/api.js" async defer></script>
|
<script src="https://www.google.com/recaptcha/api.js" async defer></script>
|
||||||
|
@ -24,7 +24,8 @@ pageContext.setAttribute("required", "true");
|
||||||
|
|
||||||
<p class="lead">Expression of Interest for the EU Multi-Actor
|
<p class="lead">Expression of Interest for the EU Multi-Actor
|
||||||
Platform</p>
|
Platform</p>
|
||||||
<aui:form action="<%=validateURL%>" method="post" name="fm" id="movingForm">
|
<aui:form action="<%=validateURL%>" method="post" name="fm"
|
||||||
|
id="movingForm">
|
||||||
<aui:fieldset>
|
<aui:fieldset>
|
||||||
<aui:input label="Name" name="name" type="text" required="${required}"
|
<aui:input label="Name" name="name" type="text" required="${required}"
|
||||||
style="width:300px;" />
|
style="width:300px;" />
|
||||||
|
@ -32,11 +33,11 @@ pageContext.setAttribute("required", "true");
|
||||||
required="${required}" style="width:300px;" />
|
required="${required}" style="width:300px;" />
|
||||||
<aui:input label="Organisation" name="organisation" type="text"
|
<aui:input label="Organisation" name="organisation" type="text"
|
||||||
required="${required}" style="width:300px;" />
|
required="${required}" style="width:300px;" />
|
||||||
<!--
|
<!--
|
||||||
SELECT
|
SELECT
|
||||||
-->
|
-->
|
||||||
<aui:select label="Organisation Type" name="organisationType"
|
<aui:select label="Type of Organisation / Stakeholder"
|
||||||
required="${required}" showEmptyOption="true"
|
name="organisationType" required="${required}" showEmptyOption="true"
|
||||||
style="width:800px;">
|
style="width:800px;">
|
||||||
<c:forEach var="type" items="${organisation_types}">
|
<c:forEach var="type" items="${organisation_types}">
|
||||||
<aui:option value="${type}">${type}</aui:option>
|
<aui:option value="${type}">${type}</aui:option>
|
||||||
|
@ -52,49 +53,67 @@ pageContext.setAttribute("required", "true");
|
||||||
<aui:fieldset>
|
<aui:fieldset>
|
||||||
<aui:input id="participatedInActivities " type="checkbox"
|
<aui:input id="participatedInActivities " type="checkbox"
|
||||||
name="participatedInActivities"
|
name="participatedInActivities"
|
||||||
label=" Have you participated in the activities of any of our MOVING Regional Multi-Actors Platforms?" />
|
label=" Have you participated in the activities of any of our MOVING Regional Multi-Actors Platforms?"
|
||||||
<!--
|
required="${required}" />
|
||||||
SELECT
|
|
||||||
-->
|
|
||||||
<aui:select
|
|
||||||
label=" What is your main motivation for joining the EU MAP of MOVING?"
|
<div class="control-group input-text-wrapper">
|
||||||
name="mainMotivation" required="${required}" showEmptyOption="true"
|
<aui:field-wrapper name="mainMotivation"
|
||||||
style="width:800px;">
|
label="What is your main motivation for joining the EU MAP of MOVING? (Required)">
|
||||||
<c:forEach var="type" items="${main_motivations}">
|
<!-- the first is needed as placeholder otherwise the validator does not work, make sure you take into account in the server part -->
|
||||||
<aui:option value="${type}">${type}</aui:option>
|
<aui:input id="mainMotivation" type="checkbox"
|
||||||
</c:forEach>
|
name="mainMotivation" cssClass="first-checkbox-hidden" label=""/>
|
||||||
</aui:select>
|
<c:forEach var="type" items="${main_motivations}">
|
||||||
|
<aui:input id="mainMotivation" type="checkbox"
|
||||||
|
name="mainMotivation" label="${type}"/>
|
||||||
|
</c:forEach>
|
||||||
|
</aui:field-wrapper>
|
||||||
|
</div>
|
||||||
|
<aui:spacer></aui:spacer>
|
||||||
|
|
||||||
<aui:input
|
<aui:input
|
||||||
label="Please elaborate on your motivation expressed above so that we understand better your interest, and form a dynamic and relevant community. Vague explanations of the motivation might not be taken into consideration."
|
label="Please elaborate on your motivation expressed above so that we understand better your interest, and form a dynamic and relevant community. Vague explanations of the motivation might not be taken into consideration."
|
||||||
name="textareaMotivation" type="textarea" style="width:800px;"
|
name="textareaMotivation" type="textarea" style="width:800px;"
|
||||||
placeholder="Free text 150 words" />
|
placeholder="Free text 150 words" />
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
SELECT Multi areas_of_expertise
|
Multi areas_of_expertise
|
||||||
-->
|
-->
|
||||||
<aui:select
|
|
||||||
label="What is your main area of expertise in relation to mountain sustainability and resilience? (Multiple choice)"
|
<div class="control-group input-text-wrapper">
|
||||||
name="areaOfExpertiseSelect" required="${required}"
|
<aui:field-wrapper name="areaOfExpertiseSelect"
|
||||||
style="width:800px;" multiple="true">
|
label="What is your main area of expertise in relation to
|
||||||
<c:forEach var="type" items="${areas_of_expertise}">
|
mountain sustainability and resilience? (Required)">
|
||||||
<aui:option value="${type}">${type}</aui:option>
|
<!-- the first is needed as placeholder otherwise the validator does not work, make sure you take into account in the server part -->
|
||||||
</c:forEach>
|
<aui:input id="areaOfExpertiseSelect" type="checkbox"
|
||||||
</aui:select>
|
name="areaOfExpertiseSelect" cssClass="first-checkbox-hidden" label=""/>
|
||||||
<!-- String[] items = actionRequest.getParameterValues("areaOfExpertiseSelect"); -->
|
<c:forEach var="type" items="${areas_of_expertise}">
|
||||||
|
<aui:input id="areaOfExpertiseSelect" type="checkbox"
|
||||||
|
name="areaOfExpertiseSelect" label="${type}" showRequiredLabel="false"/>
|
||||||
|
</c:forEach>
|
||||||
|
</aui:field-wrapper>
|
||||||
|
</div>
|
||||||
|
<aui:spacer></aui:spacer>
|
||||||
|
|
||||||
<aui:input
|
<aui:input
|
||||||
label="Please elaborate on the relevant experience you can bring to mountain value chains and the resilience of these areas, so that we have more detailed information to be able to form a dynamic and relevant community."
|
label="Please elaborate on the relevant experience you can bring to mountain value chains and the resilience of these areas, so that we have more detailed information to be able to form a dynamic and relevant community."
|
||||||
name="textareaExperience" type="textarea" style="width:800px;"
|
name="textareaExperience" type="textarea" style="width:800px;"
|
||||||
placeholder="Free text 150 words" />
|
placeholder="Free text 150 words" />
|
||||||
<!--
|
|
||||||
SELECT
|
<div class="control-group input-text-wrapper">
|
||||||
-->
|
<aui:field-wrapper name="commitment"
|
||||||
<aui:select
|
label="As a starting point, the degree of participation you commit to is: (Required)">
|
||||||
label="As a starting point, the degree of participation you commit to is:"
|
<!-- the first is needed as placeholder otherwise the validator does not work, make sure you take into account in the server part -->
|
||||||
name="commitment" required="${required}" showEmptyOption="true"
|
<aui:input id="commitment" type="checkbox"
|
||||||
style="width:800px;">
|
name="commitment" cssClass="first-checkbox-hidden" label=""/>
|
||||||
<c:forEach var="type" items="${degrees_of_participation}">
|
<c:forEach var="type" items="${degrees_of_participation}">
|
||||||
<aui:option value="${type}">${type}</aui:option>
|
<aui:input id="commitment" type="checkbox" name="commitment"
|
||||||
</c:forEach>
|
label="${type}" />
|
||||||
</aui:select>
|
</c:forEach>
|
||||||
|
</aui:field-wrapper>
|
||||||
|
</div>
|
||||||
|
|
||||||
<aui:spacer></aui:spacer>
|
<aui:spacer></aui:spacer>
|
||||||
<p class="lead">Data Management</p>
|
<p class="lead">Data Management</p>
|
||||||
<p>
|
<p>
|
||||||
|
@ -104,10 +123,8 @@ pageContext.setAttribute("required", "true");
|
||||||
Protection Regulation (EU) 2016/679 of 27 April 2016 (GDPR) and other
|
Protection Regulation (EU) 2016/679 of 27 April 2016 (GDPR) and other
|
||||||
applicable rules, for the management of the activity and to send
|
applicable rules, for the management of the activity and to send
|
||||||
other electronic communications of content related to it. Read more
|
other electronic communications of content related to it. Read more
|
||||||
in our
|
in our <a href="https://www.moving-h2020.eu/privacy-cookies-policy/"
|
||||||
<aui:a href="https://www.moving-h2020.eu/privacy-cookies-policy/"
|
target="_blank">Privacy Policy</a> .
|
||||||
target="_blank">Privacy Policy</aui:a>
|
|
||||||
.
|
|
||||||
</p>
|
</p>
|
||||||
<aui:input id="privacyPolicyAgree" type="checkbox"
|
<aui:input id="privacyPolicyAgree" type="checkbox"
|
||||||
name="privacyPolicyAgree" label=" I Agree" required="${required}" />
|
name="privacyPolicyAgree" label=" I Agree" required="${required}" />
|
||||||
|
@ -116,31 +133,78 @@ pageContext.setAttribute("required", "true");
|
||||||
Submit Button
|
Submit Button
|
||||||
-->
|
-->
|
||||||
<div style="width: 100%; text-align: center;">
|
<div style="width: 100%; text-align: center;">
|
||||||
<div class="g-recaptcha" data-sitekey="6Ld0hfYZAAAAAKlIHde1v3QE4NyY4AniN6j-U9SP"></div>
|
<!-- <div class="g-recaptcha" -->
|
||||||
<br/>
|
<!-- data-sitekey="6Ld0hfYZAAAAAKlIHde1v3QE4NyY4AniN6j-U9SP"></div> -->
|
||||||
|
<!-- <br /> -->
|
||||||
<aui:button-row>
|
<aui:button-row>
|
||||||
<aui:button value="Submit your application" type="submit"
|
<aui:button value="Submit your application" type="submit"
|
||||||
cssClass="btn-large btn-fill" />
|
cssClass="btn-large btn-fill" />
|
||||||
</aui:button-row>
|
</aui:button-row>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</aui:form>
|
</aui:form>
|
||||||
|
|
||||||
<script type="text/javascript">
|
|
||||||
AUI().use(
|
<aui:script>
|
||||||
'aui-tooltip', 'aui-base', 'selector-css3',
|
AUI().use('aui-form-validator', 'aui-overlay-context-panel', function(A) {
|
||||||
function (A) {
|
|
||||||
var form = A.one('#<portlet:namespace />fm');
|
// Extending Alloy Default values for FormValidator RULES
|
||||||
if (form) {
|
var DEFAULTS_FORM_VALIDATOR = A.config.FormValidator;
|
||||||
form.on(
|
A.mix(
|
||||||
'submit',
|
DEFAULTS_FORM_VALIDATOR.RULES,
|
||||||
function(event) {
|
{
|
||||||
if (grecaptcha.getResponse() === '') {
|
requiredCheckbox:function (val, fieldNode, ruleValue) {
|
||||||
event.halt();
|
var counter = 0;
|
||||||
event.stopImmediatePropagation();
|
var nodeName = fieldNode.attr('name');
|
||||||
alert('Please prove you are not a robot');
|
var checkBoxes = A.all("input[name='" + nodeName + "']").val();
|
||||||
}
|
for (var i = 0, len = checkBoxes.length; i < len; i++ ) {
|
||||||
}
|
if (checkBoxes[i] == 'true') {
|
||||||
);
|
counter++;
|
||||||
}
|
};
|
||||||
});
|
}
|
||||||
</script>
|
console.log('counter='+counter);
|
||||||
|
return counter >= ruleValue;
|
||||||
|
},
|
||||||
|
},
|
||||||
|
true
|
||||||
|
);
|
||||||
|
|
||||||
|
// Extending Alloy Default values for FormValidator STRINGS
|
||||||
|
A.mix(
|
||||||
|
DEFAULTS_FORM_VALIDATOR.STRINGS,
|
||||||
|
{
|
||||||
|
requiredCheckbox: '<liferay-ui:message
|
||||||
|
key="Please select at least one of the following options: " />'
|
||||||
|
},
|
||||||
|
true
|
||||||
|
);
|
||||||
|
|
||||||
|
// Specify the form validation rules to be applied on this form
|
||||||
|
var rules = {
|
||||||
|
<portlet:namespace />areaOfExpertiseSelect: {
|
||||||
|
requiredCheckbox: 1
|
||||||
|
},
|
||||||
|
<portlet:namespace />mainMotivation: {
|
||||||
|
requiredCheckbox: 1
|
||||||
|
},
|
||||||
|
<portlet:namespace />commitment: {
|
||||||
|
requiredCheckbox: 1
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
// filedStrings to override the standard error msgs
|
||||||
|
var fieldStrings = {
|
||||||
|
};
|
||||||
|
|
||||||
|
new A.FormValidator(
|
||||||
|
{
|
||||||
|
boundingBox: '#<portlet:namespace />fm',
|
||||||
|
fieldStrings: fieldStrings,
|
||||||
|
rules: rules,
|
||||||
|
showAllMessages: true
|
||||||
|
}
|
||||||
|
);
|
||||||
|
});
|
||||||
|
</aui:script>
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue