Created
October 29, 2015 21:51
-
-
Save pottedmeat7/0d0c9303703dc586684e to your computer and use it in GitHub Desktop.
new create form with js partial
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//hide bootstrap modal | |
waitingDialog.hide(); | |
//append and show new empty form | |
jQuery(".newcontactholder").append("<%= escape_javascript(render 'new') %>"); | |
jQuery(".newcontactholder").show(); | |
//init autocomplete on name field | |
jQuery("#<%= @formID %> .searchContactNameField").autocomplete({ | |
source: "/contact_name_autocomplete_search", | |
minLength: 3, | |
select: function(event, ui) { | |
//auto populate other fields when selected item | |
jQuery("#<%= @formID %> .autopop1").val(ui.item.item_field1); | |
} | |
}); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment