struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From str...@pandora.be
Subject html:javascript simple question
Date Thu, 19 Feb 2004 10:27:08 GMT
Hi,
In my jsp's i do on the bottom of the jsp:

<script>
  today();
</script>

In my head section i then define the method...

function today(){
	  var today = new Date();
	  var month = today.getMonth()+1;
	  var year = today.getYear();
	  var day = today.getDate();
	  if(day<10) day = "0" + day;
	  if(month<10) month= "0" + month ;
	  if(year<1000) year+=1900;
	  var date=day + "/" + month + "/" + year;
	  window.document.forms[0]'shipments.shipmentDate'].value=date;
}

This is working fine, but thaught might there be a better way doing this ? Using html:javascript
? 

Thanks !!



---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


Mime
View raw message