You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by st...@pandora.be on 2004/02/19 11:27:08 UTC

html:javascript simple question

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