ECOM-626 Added required check for select dropdowns and validation

This commit is contained in:
AlasdairSwan
2014-11-10 09:58:25 -05:00
parent ad3c11e58e
commit cb5c03f0d1
7 changed files with 75 additions and 23 deletions

View File

@@ -87,7 +87,18 @@ var edx = edx || {};
},
isBlank: function( $el ) {
return ( $el.attr('type') === 'checkbox' ) ? !$el.prop('checked') : !$el.val();
var type = $el.attr('type'),
isBlank;
if ( type === 'checkbox' ) {
isBlank = !$el.prop('checked');
} else if ( type === 'select' ) {
isBlank = ( $el.data('isdefault') === true );
} else {
isBlank = !$el.val();
}
return isBlank;
},
email: {