Advertisement

Replacing Cal button with image

Moderators: Calcifer, slothy

Replacing Cal button with image

Postby essexgou » Wed May 30, 2007 6:29 pm

Hi,

To fit in with the overall look of my site, I wanted to put a calandar image instead of the Cal button. However, when I try this, the image does not show up on the live form and when I click it, the calendar opens and closes straight away.... Can you help?

I have added the following image input:
<input name="button" type="image" src="/images/date.gif" onclick="displayCalendar(document.forms[0].theDate2,'dd/mm/yyyy',this)">

Thanks!
essexgou
 
Posts: 6
Joined: Wed May 30, 2007 6:12 pm

Postby essexgou » Tue Jun 05, 2007 10:56 pm

I have found out how to do this, an example:
Instead of:
<input type="button" value="Calendar" onclick="displayCalendar(document.forms[0].theDate2,'dd.mm.yyyy',this)">

Enter:
<a href="#" onClick="displayCalendar(document.cal.theDate2,'dd.mm.yyyy',this);return false"><img src="images/cal.gif" >

where images/cal.gif is your image file path and image name.

Works a treat.
essexgou
 
Posts: 6
Joined: Wed May 30, 2007 6:12 pm


Return to Calendar script questions

Who is online

Users browsing this forum: No registered users and 11 guests

cron