ninja / ui

Ninja User Interface, the jQuery plugin for lethal interaction.
http://ninjaui.com
Apache License 2.0
284 stars 23 forks source link

No obvious way to name autocomplete input #50

Open six8 opened 12 years ago

six8 commented 12 years ago

You can't specify the name for the input field with the normal autocomplete options.

It would be nice to do:

$autocomplete = $.ninja.autocomplete({name: 'q'})

However this just puts the name on the wrapping span.

Currently you have to do the following which is neither obvious or convenient:

$autocomplete.find('input').attr('name', 'q')
uipoet commented 12 years ago

Good point. I think the best solution will be to accept an array of attributes as an option and pass them all through to the input, like how we pass through css and html in other areas:

$autocomplete = $.ninja.autocomplete({
  attr: {
    name: 'q'
  }
}