USE JAVA SCRIPT at the end of your html page
</body>
<script language = "Javascript">
selectDate();
</script>
and the script would be in the head tag
<head>
<script language="Javascript">
function selectDate()
{
var date = new Date();
var month = date.getMonth()+1;
var day = date.getDate();
var year = date.getYear();
for(i=0;i<document.cand.dd.options.length;i++)
{
if(document.cand.dd.options[i].value==day)
{
document.cand.dd.options[i].selected=true;
}
}
for(i=0;i<document.cand.mon.options.length;i++)
{
if(document.cand.mon.options[i].value==month)
{
document.cand.mon.options[i].selected=true;
}
}
document.cand.yr.value=year;
}
</script>
</head>
hope this helps
Regards
Ramesh Kesavanarayanan
[EMAIL PROTECTED]
Off : 8113801 ext 2333
Res : 2265360
Mob : 98412 73573
> -----Original Message-----
> From: Gading [SMTP:[EMAIL PROTECTED]]
> Sent: Wednesday, May 01, 2002 2:32 PM
> To: [EMAIL PROTECTED]
> Subject: Converting date to int
>
> I have jsp page wich shows select item for day , month , year.
> I need to have current date is selected by default, how to obtain that?
>
> Im trying to use SimpleDateFormat df = new SimpleDateFormat("d");
>
> but it return string and can not convert to int.
>
> ==========================================================================
> =
> To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
> JSP-INTEREST".
> For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST
> DIGEST".
> Some relevant FAQs on JSP/Servlets can be found at:
>
> http://archives.java.sun.com/jsp-interest.html
> http://java.sun.com/products/jsp/faq.html
> http://www.esperanto.org.nz/jsp/jspfaq.jsp
> http://www.jguru.com/faq/index.jsp
> http://www.jspinsider.com
===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:
http://archives.java.sun.com/jsp-interest.html
http://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.jsp
http://www.jguru.com/faq/index.jsp
http://www.jspinsider.com