Skip to main content

typeahead static auto suggest



<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Typeahead</title>
<script  type="text/javascript" src="jquery.min.js"></script>
<script  type="text/javascript" src="typeahead.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$('input.typeahead').typeahead({
name: 'accounts',
local: ["Bangalore","Bidar","Ganagapur","Gulbarga","Raichur"]
});
});  
</script>
<style type="text/css">
.bs-example{
font-family: sans-serif;
position: relative;
margin: 100px;

}
.typeahead, .my-query, .my-hint {
border: 1px solid #CCCCCC;
border-radius: 8px;
font-size: 18px;
height: px;
line-height: 20px;
outline: medium none;
padding: 8px 12px;
width: 240px;
}
.typeahead {
background-color: #FFFFFF;
}
.typeahead:focus {
border: 2px solid #0097CF;
}
.my-query {
box-shadow: 0 1px 1px rgba(0, 0, 0, 0.075) inset;
}
.my-hint {
color: #999999;
}
.my-dropdown-menu {
background-color: #FFFFFF;
border: 1px solid rgba(0, 0, 0, 0.2);
border-radius: 8px;
box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);
margin-top: 12px;
padding: 8px 0;
width: 250px;
}
.my-suggestion {
font-size: 16px;
line-height: 24px;
padding: 3px 20px;
}
.my-suggestion.my-is-under-cursor {
background-color: #0097CF;
color: #FFFFFF;
}
.my-suggestion p {
margin: 0;
}
</style>
</head>
<body>
    <div class="bs-example">
        Location: <input type="text" class="typeahead my-query" autocomplete="off" spellcheck="false">
    </div>
</body>
</html>                                

Comments

Popular posts from this blog

Get Current Location & Address in PHP

index.php ____________________________________________________________________ <!DOCTYPE html> <head> <title>GEt Current Location</title> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js"></script> <script type="text/javascript"> jQuery(function($){ var lat = $('#lat'); var lng = $('#lng'); $('#submit').click(function(){ jQuery.ajax({ url: 'get_address.php', type: 'post', data: 'lat=' + lat.val() + '&lng='+lng.val(), success: function(results){ $("#ack").val(results) } }); }); }); </script> <script> if(!navigator.geolocation){ alert('Your Browser does not support HTML5 Geo Location. Please Use Newer Version Browsers'); } navigator.geolocation.getCurrentPosition(success, error); function success(position){ var latit...

send a id by GET method

db.php _________________________________________________________________ <?php  $query=mysql_query("INSERT INTO employee VALUES ('$id','$name')"); if($query)  {      header('location:index.php?msg'); }?> _________________________________________________________________ index.php _________________________________________________________________ <?php if(isset($_GET['msg'])) {  $comp = $_GET['msg']; ?>     <div class="alert alert-success">           Thank you, this is message by GET id      </div> <?php } ?> _________________________________________________________________