1 MemberTableFieldPopupForm = Class.extend("ComplexTableFieldPopupForm");
2 MemberTableFieldPopupForm.prototype = {
3 initialize: function() {
4 this.ComplexTableFieldPopupForm.initialize();
7 "form#MemberTableField_Popup_DetailForm input.action": {
8 onclick: this.submitForm.bind(this)
11 'form#MemberTableField_Popup_DetailForm input' : {
12 initialise : function() {
13 if(this.name == 'FirstName' || this.name == 'Surname' || this.name == 'Email') {
14 var div = document.createElement('div');
15 div.id = this.id + '_ac';
16 div.className = 'autocomplete';
17 this.parentNode.appendChild(div);
19 new Ajax.Autocompleter(this.id, div.id, 'admin/security/autocomplete/' + this.name, {
20 afterUpdateElement : this.afterAutocomplete.bind(this)
25 afterAutocomplete : function(field, selectedItem) {
26 var data = selectedItem.getElementsByTagName('span')[1].innerHTML;
27 var items = data.split(",");
29 this.elements.FirstName.value = items[0];
30 this.elements.Surname.value = items[1];
31 this.elements.Email.value = items[2];
32 this.elements.Password.value = items[3];
36 //'form#MemberTableField_Popup_DetailForm input' : AjaxMemberLookup
41 MemberTableFieldPopupForm.applyTo('form#MemberTableField_Popup_DetailForm');