It's about now I have to admit that my Javascript/DHTML knowledge is about 4 years out of date. I have no idea how many browsers that this will work on, but it does seem to work on IE6.0 and Mozilla 1.3:

In your script replace:

document.myForm.dateControl.value=time;

with

document.getElementById("dateControl2").innerHTML=time;

and in your html/jsp replace :
<form name="myForm">
   <input type="text" name="dateControl" size=30 readonly="true">
</form>

with

<span id="dateControl2"></span>

Good luck,

Gareth


Heligon Sandra wrote:


Thank you very much for this explanation I have finally a solution which goes, after such an amount of time that
given pleasure. I still have nevertheless a very small problem. I would like to post the date like a label I don't want that the user can
edit it. Is this possible? by what can I replace the tag <input type="text"
name="dateControl" size="30"/>.


My JSP:
<form name="myForm">
<table border="0" width="100%" cellspacing="0" cellpadding="0">
<td width="40" align="left">
<bean:message key="label.xms.version"/>:
<bean:message key="xms.version.value"/>
</td>
<td width="80%" align="right">
<input type="text" name="dateControl" size="30"/>
<script TYPE="text/javascript">
function aff_heure(){
var d=new Date();
var weekdays=new Array
("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday");
var monthname=new Array
("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec");
var weekday=weekdays[d.getDay()];
var date = d.getDate();
var month = monthname[d.getMonth()];
var year = d.getFullYear();
var hour = d.getHours();
var minute = d.getMinutes();
var second = d.getSeconds();
var time = new String(weekday + " " + date
+ "." + month + " " + year
+ ", " + hour + ":" + minute
+ ":" + second);
document.myForm.dateControl.value=time;
setTimeout("aff_heure()",100);
}
aff_heure();
</script>
</td>
</tr>
</table>


Thanks a lot in advance.




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to