if(fmcls == 'au') {
switch(fmfield) {
+ case 'usrname':
+ dojo.connect(widget.widget, 'onChange',
+ function() {
+ var input = findWidget('au', 'usrname');
+ var usrname = input.widget.attr('value');
+
+ if(!usrname) {
+ dojo.addClass(dojo.byId('uedit-dupe-username-warning'), 'hidden');
+ return;
+ }
+
+ fieldmapper.standardRequest(
+ ['open-ils.actor', 'open-ils.actor.username.exists'],
+ {
+ params: [openils.User.authtoken, usrname],
+ oncomplete : function(r) {
+ var res = openils.Util.readResponse(r);
+ if(res) {
+ dojo.removeClass(dojo.byId('uedit-dupe-username-warning'), 'hidden');
+ } else {
+ dojo.addClass(dojo.byId('uedit-dupe-username-warning'), 'hidden');
+ }
+ }
+ }
+ );
+ }
+ );
+
+ return;
+
case 'profile': // when the profile changes, update the expire date
dojo.connect(widget.widget, 'onChange',
function() {
<button dojoType='dijit.form.Button' jsId='allCards'>See All</button>
</td>
</tr>
- <tr fmclass='au' fmfield='usrname' required='required'/>
+ <tr fmclass='au' fmfield='usrname' required='required'>
+ <td/><td/><td/>
+ <td>
+ <span id='uedit-dupe-username-warning' style='color:red; font-weight:bold' class='hidden'>
+ Username is already in use
+ </span>
+ </td>
+ </tr>
<tr fmclass='au' fmfield='passwd' required='required'/>
<tr fmclass='au' fmfield='passwd2' required='required'><td/><td>Verify Password</td><td/></tr>
<tr fmclass='au' fmfield='first_given_name' required='required'/>