Add Google Search-box on your static website

hey guys,

today i integrate Google search box widget in my website which is very useful to add search functionality in our static website.

here is step for adding google widget in your website.

Go to Google Custom Search http://www.google.com/cse/

Click on Create a Custom Search Engine

Give it a name, enter sites you want to cover with the search.

Complete the process and get the javascript. Integrate the script into your static page.

Screenshot:

google search box

you can also customize this widget using different layout options. for example i want to display search result in new window tab. so i customized my code like

<gcse:searchbox-only newWindow=true></gcse:searchbox-only>

newWindow=true

visit Custom Search Element Control API for more information.

hope you like this post 🙂

How to create a current year to 1900 select box in JSP

hey guys,

i got one simple logic to create a current year to 1900 select box. lets go for coding.

<select>

<%    
Date dNow = new Date( );    
SimpleDateFormat = new SimpleDateFormat ("yyyy");    
String year = ft.format(dNow);    
int foo = Integer.parseInt(year);    
while(foo > 1989)
{
%>

<option value=”<%=foo%>”><%=foo%></option>

<%        
 foo--;            
}
 %>

</select>

how to disable past date in jquery datepicker

hey guys,

here is simple code for disable past date in jquery datepicker.

Declare todaydate variable and use Date() function to set it.. then use that variable to assign to minDate which is parameter of datepicker. you can also change numberofMonths according to your requirement.

numberOfMonths: 3,

oky lets go for code.

 var dateToday = new Date();
  $(function() {
   $( "#datepicker" ).datepicker({
        numberOfMonths: 1,
        showButtonPanel: true,
        minDate: dateToday
    });
  });

html code

Date: <input type=”text” id=”datepicker” />

 

Hope you like it.! 🙂