X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=portal%2Ftemplates%2Fregistration_view.html;h=1f27d4188ea8c0de9ef1f3386d6dab1692ee9d7b;hb=ccbd6e9fc2ff9e6683e38d13220ffc9dccfb20ea;hp=5ce34592ec56d300166f80ae9e08fa9f47c980fa;hpb=5d6232c324cc1baa1117854ff498c910994e4bfd;p=myslice.git diff --git a/portal/templates/registration_view.html b/portal/templates/registration_view.html index 5ce34592..1f27d418 100644 --- a/portal/templates/registration_view.html +++ b/portal/templates/registration_view.html @@ -34,10 +34,10 @@

Enter your last name

- +
- +

An authority responsible for vetting your account

@@ -108,15 +108,28 @@ jQuery(document).ready(function(){ var availableTags = [ {% if authorities %} {% for authority in authorities %} - {value:"{{ authority.authority_hrn }}",label:"{{authority.name}}"}, + {% if authority.name %} + {value:"{{ authority.authority_hrn }}",label:"{{authority.name}}"}, + {% else %} + {value:"{{ authority.authority_hrn }}",label:"{{authority.authority_hrn}}"}, + {% endif %} {% endfor %} {% else %} {value:"",label:"No authority found !!!"} {% endif %} ]; - $( "#auth_list" ).autocomplete({ + jQuery( "#authority_hrn" ).autocomplete({ source: availableTags, - select: function( event, ui ) {console.log(jQuery(this))} + minLength: 0, + change: function (event, ui) { + if(!ui.item){ + //http://api.jqueryui.com/autocomplete/#event-change - + // The item selected from the menu, if any. Otherwise the property is null + //so clear the item for force selection + jQuery("#authority_hrn").val(""); + } + } + //select: function( event, ui ) {console.log(jQuery(this))} }); });