Recent Bloggers
Tanweer Ahmed Ansari Posts: 2
Stars: 2
Date: 7/23/10
Savio Edward Coelho Posts: 1
Stars: 0
Date: 7/9/10
Muhammed Shakir Misarwala Posts: 8
Stars: 0
Date: 6/30/10
vc vijayan Posts: 5
Stars: 0
Date: 6/24/10
  Blogs Aggregator
Finder Methods in Liferay
finder finder methods liferay finder methods service layer
  I have come across many newbies who find it difficuilt understanding & implementing the finder methods in Liferay.This blog will come as a rescue to those beginners.Here I will first
Implementing XMLBeans
xml binding xml marshal xml unmarshal xml to java xmlbeans
  XMLBeans is a fantastic technology provided by Apache which is used for marshalling and un-marshalling XML.This helps us to bind XML into Java Types.In this blog, I will first introduce the
How to reload module in a flex application on button click....
flex action script
 Hi, We r trying to reload a module if our flex application on button clicked.... Is there a way to do so....
Subscribe to this blog. Subscribe to this blog.
Showing 3 results.
  Blogs
Blogs »
jQuery Autocomplete

 

Autocomplete is a common feature available in lot of web tools and services. You will find lots of implementation of autocomplete features.

Autocomplete is an input field to enable users quickly finding and selecting some value.

When we type character/ word in textbox, it will search matching values and will display in small division as dropdown.

Let us see how can we implement a simple Autocomplete feature in JSP page.

Required Files :

Download file :        ui.autocomplete.js

(or) 

jQuery’s autocomplete plugin

JSP Page:

<html>

<head>
<script src=”jquery.js“  type=”text/javascript”></script>
<script src=”ui.autocomplete.js“  type=”text/javascript”></script>

(or)

<script src=”jquery.autocomplete.js”  type=”text/javascript”></script>
</head>

<form>

<%  String names=”Testing,Catch,Test,Welcome”;  %>
<input type=”hidden” id=’ac‘ value=”<%=names%>”/>
<input type=”text” id=’acbox‘ />

</form>

</html>

<script type=”text/javascript”>

jQuery(document).ready(function(){
var itemNames= jQuery(‘#ac’).val();
var mydata = itemNames.split(“,”);
jQuery(‘#acbox’).autocomplete({
data:mydata,
autoFill: true
});

});

</script>

if you use plugin jquery.autocomplete.js, just give script  like this:

<script type=”text/javascript”>

jQuery(document).ready(function() {
var itemNames= jQuery(‘#ac’).val();
var mydata = itemNames.split(“,”);
jQuery(“#acbox“).autocomplete(mydata);
});

</script>

 

Output:

autocomplete

 


  • Comments
Trackback URL: