Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hidden input name= id= tweak #16

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions jquery.autoSuggest.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
* the fly. It supports keybord navigation (UP + DOWN + RETURN), as well
* as multiple AutoSuggest fields on the same page.
*
* Inspied by the Autocomplete plugin by: J�rn Zaefferer
* Inspied by the Autocomplete plugin by: J�rn Zaefferer
* and the Facelist plugin by: Ian Tearle (iantearle.com)
*
* This AutoSuggest jQuery plug-in is dual licensed under the MIT and GPL licenses:
Expand All @@ -23,6 +23,8 @@
$.fn.autoSuggest = function(data, options) {
var defaults = {
asHtmlID: false,
asHiddenInputName: false,
asHiddenInputID: false,
startText: "Enter Name Here",
emptyText: "No Results Found",
preFill: {},
Expand Down Expand Up @@ -81,7 +83,9 @@
var org_li = $("#as-original-"+x);
var results_holder = $('<div class="as-results" id="as-results-'+x+'"></div>').hide();
var results_ul = $('<ul class="as-list"></ul>');
var values_input = $('<input type="hidden" class="as-values" name="as_values_'+x+'" id="as-values-'+x+'" />');
if ( opts.asHiddenInputID != false ) { var asHiddenInputID = opts.asHiddenInputID; } else { var asHiddenInputID = 'as-values-'+x;}
if ( opts.asHiddenInputName != false ) { var asHiddenInputName = opts.asHiddenInputName; } else { var asHiddenInputName = 'as_values_'+x;}
var values_input = $('<input type="hidden" class="as-values" name="'+asHiddenInputName+'" id="'+asHiddenInputID+'" />');
var prefill_value = "";
if(typeof opts.preFill == "string"){
var vals = opts.preFill.split(",");
Expand Down