Commit 06cbe161 by AlasdairSwan

After accessibility review removed required field aria-describedby

parent a5001bab
...@@ -28,9 +28,6 @@ var edx = edx || {}; ...@@ -28,9 +28,6 @@ var edx = edx || {};
// String to append to required label fields // String to append to required label fields
requiredStr: '*', requiredStr: '*',
// Id of required footnote
requiredNote: 'register-footnote',
initialize: function( data ) { initialize: function( data ) {
this.model = data.model; this.model = data.model;
this.preRender( data ); this.preRender( data );
...@@ -74,8 +71,7 @@ var edx = edx || {}; ...@@ -74,8 +71,7 @@ var edx = edx || {};
var html = [], var html = [],
i, i,
len = data.length, len = data.length,
fieldTpl = this.fieldTpl, fieldTpl = this.fieldTpl;
requiredNote = '';
this.fields = data; this.fields = data;
...@@ -84,12 +80,9 @@ var edx = edx || {}; ...@@ -84,12 +80,9 @@ var edx = edx || {};
data[i].errorMessages = this.escapeStrings( data[i].errorMessages ); data[i].errorMessages = this.escapeStrings( data[i].errorMessages );
} }
requiredNote = data[i].required ? this.requiredNote : '';
html.push( _.template( fieldTpl, $.extend( data[i], { html.push( _.template( fieldTpl, $.extend( data[i], {
form: this.formType, form: this.formType,
requiredStr: this.requiredStr, requiredStr: this.requiredStr
requiredNote: requiredNote
}) ) ); }) ) );
} }
......
...@@ -18,8 +18,6 @@ var edx = edx || {}; ...@@ -18,8 +18,6 @@ var edx = edx || {};
formType: 'register', formType: 'register',
requiredNote: 'register-footnote',
preRender: function( data ) { preRender: function( data ) {
this.providers = data.thirdPartyAuth.providers || []; this.providers = data.thirdPartyAuth.providers || [];
this.currentProvider = data.thirdPartyAuth.currentProvider || ''; this.currentProvider = data.thirdPartyAuth.currentProvider || '';
...@@ -58,6 +56,6 @@ var edx = edx || {}; ...@@ -58,6 +56,6 @@ var edx = edx || {};
saveSuccess: function() { saveSuccess: function() {
this.trigger('auth-complete'); this.trigger('auth-complete');
}, }
}); });
})(jQuery, _, gettext); })(jQuery, _, gettext);
...@@ -10,8 +10,7 @@ ...@@ -10,8 +10,7 @@
<select id="<%= form %>-<%= name %>" <select id="<%= form %>-<%= name %>"
name="<%= name %>" name="<%= name %>"
class="input-inline" class="input-inline"
aria-describedby="<%= form %>-<%= name %>-desc <%= requiredNote %>" aria-describedby="<%= form %>-<%= name %>-desc"
oninvalid="setCustomValidity(' ')"
<% if ( required ) { %> aria-required="true" required<% } %>> <% if ( required ) { %> aria-required="true" required<% } %>>
<% _.each(options, function(el) { %> <% _.each(options, function(el) { %>
<option value="<%= el.value%>"<% if ( el.default ) { %> data-isdefault="true"<% } %>><%= el.name %></option> <option value="<%= el.value%>"<% if ( el.default ) { %> data-isdefault="true"<% } %>><%= el.name %></option>
...@@ -22,8 +21,7 @@ ...@@ -22,8 +21,7 @@
type="<%= type %>" type="<%= type %>"
name="<%= name %>" name="<%= name %>"
class="input-block" class="input-block"
aria-describedby="<%= form %>-<%= name %>-desc <%= requiredNote %>" aria-describedby="<%= form %>-<%= name %>-desc"
oninvalid="setCustomValidity(' ')"
<% if ( restrictions.min_length ) { %> minlength="<%= restrictions.min_length %>"<% } %> <% if ( restrictions.min_length ) { %> minlength="<%= restrictions.min_length %>"<% } %>
<% if ( restrictions.max_length ) { %> maxlength="<%= restrictions.max_length %>"<% } %> <% if ( restrictions.max_length ) { %> maxlength="<%= restrictions.max_length %>"<% } %>
<% if ( typeof errorMessages !== 'undefined' ) { <% if ( typeof errorMessages !== 'undefined' ) {
...@@ -37,8 +35,7 @@ ...@@ -37,8 +35,7 @@
type="<%= type %>" type="<%= type %>"
name="<%= name %>" name="<%= name %>"
class="input-block <% if ( type === 'checkbox' ) { %>checkbox<% } %>" class="input-block <% if ( type === 'checkbox' ) { %>checkbox<% } %>"
aria-describedby="<%= form %>-<%= name %>-desc <%= requiredNote %>" aria-describedby="<%= form %>-<%= name %>-desc"
oninvalid="setCustomValidity(' ')"
<% if ( restrictions.min_length ) { %> minlength="<%= restrictions.min_length %>"<% } %> <% if ( restrictions.min_length ) { %> minlength="<%= restrictions.min_length %>"<% } %>
<% if ( restrictions.max_length ) { %> maxlength="<%= restrictions.max_length %>"<% } %> <% if ( restrictions.max_length ) { %> maxlength="<%= restrictions.max_length %>"<% } %>
<% if ( required ) { %> aria-required="true" required<% } %> <% if ( required ) { %> aria-required="true" required<% } %>
......
...@@ -25,5 +25,5 @@ ...@@ -25,5 +25,5 @@
<%= context.fields %> <%= context.fields %>
<button class="action action-primary action-update js-register register-button"><%- gettext("Register") %></button> <button class="action action-primary action-update js-register register-button"><%- gettext("Register") %></button>
<p id="register-footnote" class="note">* <%- gettext("Required field") %></p> <p class="note">* <%- gettext("Required field") %></p>
</form> </form>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment