Created
October 7, 2012 16:27
-
-
Save dinnouti/3848827 to your computer and use it in GitHub Desktop.
Replace input select with jquery ui autocomplete
This file contains hidden or 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
asd = -> | |
$('.shipping').each -> | |
option = [] | |
$(this).find('option').each -> | |
option.push $(this).text() | |
input = $('<input>') | |
input.attr('type','text') | |
input.attr('name', $(this).attr('name') ) | |
input.attr('id', $(this).attr('id') ) | |
input.attr('class', $(this).attr('class') ) | |
$(this).replaceWith(input) | |
$(input).autocomplete({ | |
source: option | |
}); | |
asd() |
This file contains hidden or 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
Shipping method: | |
<select id='shp_id' class='shipping' name="shipping_name"> | |
<option value="1"> standard</option> | |
<option value="2"> 2-day</option> | |
<option value="3"> overnight</option> | |
</select> | |
<br /> | |
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment