AUTOCOMPLETE TEXT FIELD IN JAVASCRIPT RAILS
AUTOCOMPLETE TEXT FIELD IN JAVASCRIPT RAILS
HTML PAGE<%= text_area_tag :query_editor, '', :onkeyup => "textAreaAdjust(this)", :onclick => "textAreaAdjust(this)", :style => "overflow:hidden" %>
<script>
function textAreaAdjust(o) {
o.style.height = "1px";
o.style.height = (1+o.scrollHeight)+"px";
}
</script>
<style type="text/css">
.add_query_editor {
margin-top: 15px !important;
min-height: 120px;
font-size: 14px !important;
padding-left: 10px !important;
padding-top: 10px !important;
width: 93% !important;
float: left;
}
</style>
WE CAN FOLLOW :-
http://jsfiddle.net/happysmile
Comments