From ea7b21c2ab82d98b538d6455e362c6038be4850c Mon Sep 17 00:00:00 2001 From: German Correa Date: Fri, 1 Dec 2017 12:02:40 -0300 Subject: [PATCH] Despliega formulario en 2 columnas --- js/registerform.js | 98 ++++++---------- registration.php | 284 ++++++++++++++++++++++++--------------------- 2 files changed, 184 insertions(+), 198 deletions(-) diff --git a/js/registerform.js b/js/registerform.js index 08a7350..d878ea3 100644 --- a/js/registerform.js +++ b/js/registerform.js @@ -12,13 +12,13 @@ $().ready(function(){ $("#pais").select2({ data: data.paises, placeholder: "Select Country", - width: "70%", + width: "100%", }); $("#roomtype").select2({ data: data.roomtypes, placeholder: "Select Rooming Preference", - width:"70%", + width:"100%", minimumResultsForSearch: -1, }); @@ -69,81 +69,49 @@ $().ready(function(){ formdata.find(item => item.name === "pais").value = $("#pais").select2("data")[0].text; formdata.find(item => item.name === "roomtype").value = $("#roomtype").select2("data")[0].text; var parameters = $.param(formdata); - console.log(parameters); + console.log(parameters); + }, errorElement: "em", errorPlacement: function ( error, element ) { - // Add the `help-block` class to the error element - - element.parents(".input-container").addClass("has-feedback"); - var esradio = element.prop("type") == "radio"; - var pariente; - if ( esradio ) { - pariente = element.parents(".form-group").children(".radioerror"); - - pariente.append(error); - error.css("color", "#a94442") - //element.parents(".form-group").children(".radioerror").append(error); - //element.parents(".radios").append(error); - - } else { - error.addClass( "help-block" ); - error.insertAfter( element ); + // Add the `help-block` class to the error element + error.addClass("help-block"); + var esradio = $(element).prop("type") == "radio"; + var padre = element.parents(".input-container"); + padre.addClass("has-feedback"); + padre.append(error); + var iconstatus = $(""); + if(!$.contains(padre,"span.glyhpicon")){ + error.before(iconstatus); } - if ( !element.next( "span" )[ 0 ] && !esradio ) - $( "" ).insertAfter( element ); - if(esradio) - element.parents(".form-group").children(".radioerror").prepend(""); - + if(esradio){ + error.css("display", "inline"); + $(iconstatus).css("display", "inline"); + $(iconstatus).css("position", "initial"); + } }, success: function(label,element){ var esradio = $(element).prop("type") == "radio"; - var pariente; - if ( esradio ) { - pariente = $(element).parents(".form-group").children(".radioerror"); - var iconstatus = $(pariente).children("span"); - if (!$(pariente).children("span")[ 0 ]) - pariente.preprend(""); + var padre = $(element).parents(".input-container"); + var iconstatus = padre.children("span.glyphicon"); + if(!iconstatus){ + label.before(""); } - else if ( !$( element ).next( "span" )[ 0 ]){ - $( "" ).insertAfter( $( element ) ); - } - - - }, highlight: function ( element, errorClass, validClass ) { - var esradio = $(element).prop("type") == "radio"; - var pariente; - if ( esradio ) { - pariente = $(element).parents(".form-group").children(".radioerror"); - pariente.addClass("has-error").removeClass("has-success"); - var iconstatus = pariente.children( "span" ); - iconstatus.addClass( "glyphicon-remove" ).removeClass( "glyphicon-ok" ); - iconstatus.css("color","#a94442"); - } - else - $( element ).next( "span" ).addClass( "glyphicon-remove" ).removeClass( "glyphicon-ok" ); - $( element ).parents( ".input-container" ).addClass( "has-error" ).removeClass( "has-success" ); - + var padre = $(element).parents(".input-container"); + var iconstatus = padre.children("span.glyphicon"); + padre.addClass("has-error").removeClass("has-success"); + iconstatus.addClass( "glyphicon-remove" ).removeClass( "glyphicon-ok" ); + padre.addClass( "has-error" ).removeClass( "has-success" ); }, unhighlight: function (element, errorClass, validClass) { - var esradio = $(element).prop("type") == "radio"; - var pariente; - if ( esradio ) { - pariente = $(element).parents(".form-group").children(".radioerror"); - pariente.addClass("has-success").removeClass("has-error"); - var iconstatus = pariente.children( "span" ); - iconstatus.addClass( "glyphicon-ok" ).removeClass( "glyphicon-remove" ); - iconstatus.css("color","#3c763d"); - - } - else - $( element ).next( "span" ).addClass( "glyphicon-ok" ).removeClass( "glyphicon-remove" ); - $( element ).parents( ".input-container" ).addClass( "has-success" ).removeClass( "has-error" ); - - } - + var padre = $(element).parents(".input-container"); + var iconstatus = padre.children("span.glyphicon"); + padre.addClass("has-success").removeClass("has-error"); + iconstatus.addClass( "glyphicon-ok" ).removeClass( "glyphicon-remove" ); + padre.addClass( "has-success" ).removeClass( "has-error" ); + } }); var finan; diff --git a/registration.php b/registration.php index 78a8714..feeba26 100644 --- a/registration.php +++ b/registration.php @@ -6,156 +6,174 @@

Registration

-
- -
- -
- + + +
+
+ +
+ +
+
+ +
+ +
+ +
-
- -
- + +
+
+ +
+ +
-
- -
- -
- -
-
- -
- -
- -
-
- -
- -
- -
-
- -
- -
- - -
-
- -
- -
- -
-
- -
- -
- -
-
-
- -
- -
-
- -
- -
-
- -
-
- - - we have submitted funding requests and hope to cover the housing - for a shared room, but we cannot make a guarantee at this time - -
-
- -
- -
-
- - -
-
- -
-
- +
+ +
+
-
+
+ +
+
+ +
+ +
- - -
-
- -
- - +
+ +
+ + +
-
- -
-
- - -
- + + +
+
+ +
+ +
-
-
- -
- -
-
- -
-
-
-
-
- + +
+
+ +
+ +
+
+
+ +
+ +
+ + +
+
+ +
+ + + +
+
+ + + we have submitted funding requests and hope to cover the housing + for a shared room, but we cannot make a guarantee at this time + +
+
+
+ + +
+
+ + +
+
+ +
+
+ +
+
+
+ +
+ +
+ + +
+
+
+ + +
+
+ +
+ +
+
+ +
+ +
+ + +
+
+
+ + +
+
+
+
+
+ + +
+
+ +
+
+