[spalenque] - #7812 *WIP

This commit is contained in:
santipalenque 2014-12-03 19:15:27 -03:00 committed by Sebastian Marcet
parent df7c1a5f90
commit 8228a5d2ea
4 changed files with 34 additions and 4 deletions

View File

@ -357,6 +357,9 @@
function renderAffiliationList(data){
if (data.length > 0) {
//remove error message
$("label.error[for='HoneyPotForm_RegistrationForm_Affiliations']").remove();
var template = $('<ul><li><div class="affiliation-header">' +
'<span class="title"></span>' +
'<span class="affiliation-actions">&nbsp;' +

View File

@ -52,6 +52,17 @@ jQuery(document).ready(function($) {
);
edit_profile_form.validate({
onfocusout: false,
invalidHandler: function(form, validator) {
var errors = validator.numberOfInvalids();
if (errors) {
var element = validator.errorList[0].element;
var offset = (element.name == 'Affiliations') ? $(element).prev().offset().top : $(element).offset().top;
$('html, body').animate({
scrollTop: offset-100
}, 2000);
}
},
ignore: [],
rules: {
FirstName:{required: true,regex:'[\"()=<>]+' },
@ -194,6 +205,17 @@ jQuery(document).ready(function($) {
);
edit_speaker_profile_form.validate({
onfocusout: false,
invalidHandler: function(form, validator) {
var errors = validator.numberOfInvalids();
if (errors) {
var element = validator.errorList[0].element;
var offset = (element.name == 'Affiliations') ? $(element).prev().offset().top : $(element).offset().top;
$('html, body').animate({
scrollTop: offset-100
}, 2000);
}
},
ignore: [],
rules: {
FirstName:{required: true, ValidPlainText:true },

View File

@ -66,7 +66,11 @@ jQuery(document).ready(function($) {
invalidHandler: function(form, validator) {
var errors = validator.numberOfInvalids();
if (errors) {
validator.errorList[0].element.focus();
var element = validator.errorList[0].element;
var offset = (element.name == 'Affiliations') ? $(element).prev().offset().top : $(element).offset().top;
$('html, body').animate({
scrollTop: offset-100
}, 2000);
}
},
ignore: [],

View File

@ -50,9 +50,10 @@
<% include Navigation %>
<!-- Page Content -->
<div class="container">
$Message
$Layout
</div>
<% include Footer %>
<% include Quantcast %>