A
Ahmed ALAMI
Hello everybody,
I want to execute an onkeypress event over a inout field included in a
table.
Depending on the fact that i specify the width value for the table,
the onkeypress is executed or not.
Here is my code
<html>
<head>
<script>
function controler()
{
var message = "";
//controle format date
message = ctrlFormatDate(document.forms[0].elements["dayDateAdhesion"],document.forms[0].elements["monthDateAdhesion"],document.forms[0].elements["yearDateAdhesion"],true);
if (message == "") {
document.forms[0].submit();
}
else {
alert(message);
}
}
</script>
</head>
<body onload="autoStart();">
<form method="post" name="actions">
<table border="0" cellspacing="0" align="center" id="table1"
width="100%">
<tr>
<th height="22" colspan="2">
Critères
</th>
</tr>
<tr>
<td height="22" class="clair" width="243" >
Date
</td>
<td height="22" class="clair" width="212">:
<input class="inputDates" type="text" name="dayDateAdhesion"
maxlength="2" size="2" value="09"
onkeypress="onkeypress_field(event,"java.lang.String",this)"
onkeyup="return onkeyup_field(event, 2, this);"
onmouseout="onmouseout_field(event,"java.lang.String",this)"
onmouseover="onmouseover_field(event,"java.lang.String",this)"
onblur="onblur_field(event,"java.lang.String",this)">/
<input class="inputDates" type="text" name="monthDateAdhesion"
maxlength="2" size="2" value="01"
onkeypress="onkeypress_field(event,"java.lang.String",this)" onkeyup="return onkeyup_field(event,
2, this);" onmouseout="onmouseout_field(event,"java.lang.String",this)"
onmouseover="onmouseover_field(event,"java.lang.String",this)" onblur="onblur_field(event,"java.lang.String",this)">/
<input class="inputDates" type="text" name="yearDateAdhesion"
length="4" size="4" value="2004"
onkeypress="onkeypress_field(event,"java.lang.String",this)"
onmouseout="onmouseout_field(event,"java.lang.String",this)" onmouseover="onmouseover_field(event,"java.lang.String",this)"
onblur="onblur_field(event,"java.lang.String",this)">
</td>
</tr>
</table>
</center>
</form>
</body>
</html>
If I specifiy a width, the method is not executed and if I don't
specify it, the method is executed.
Does anyone have an answer for that strange behaviour, and a solution
if i want to keep the width value. I tried with a style and javascript
and that doesn't work.
Thanks in advance.
I want to execute an onkeypress event over a inout field included in a
table.
Depending on the fact that i specify the width value for the table,
the onkeypress is executed or not.
Here is my code
<html>
<head>
<script>
function controler()
{
var message = "";
//controle format date
message = ctrlFormatDate(document.forms[0].elements["dayDateAdhesion"],document.forms[0].elements["monthDateAdhesion"],document.forms[0].elements["yearDateAdhesion"],true);
if (message == "") {
document.forms[0].submit();
}
else {
alert(message);
}
}
</script>
</head>
<body onload="autoStart();">
<form method="post" name="actions">
<table border="0" cellspacing="0" align="center" id="table1"
width="100%">
<tr>
<th height="22" colspan="2">
Critères
</th>
</tr>
<tr>
<td height="22" class="clair" width="243" >
Date
</td>
<td height="22" class="clair" width="212">:
<input class="inputDates" type="text" name="dayDateAdhesion"
maxlength="2" size="2" value="09"
onkeypress="onkeypress_field(event,"java.lang.String",this)"
onkeyup="return onkeyup_field(event, 2, this);"
onmouseout="onmouseout_field(event,"java.lang.String",this)"
onmouseover="onmouseover_field(event,"java.lang.String",this)"
onblur="onblur_field(event,"java.lang.String",this)">/
<input class="inputDates" type="text" name="monthDateAdhesion"
maxlength="2" size="2" value="01"
onkeypress="onkeypress_field(event,"java.lang.String",this)" onkeyup="return onkeyup_field(event,
2, this);" onmouseout="onmouseout_field(event,"java.lang.String",this)"
onmouseover="onmouseover_field(event,"java.lang.String",this)" onblur="onblur_field(event,"java.lang.String",this)">/
<input class="inputDates" type="text" name="yearDateAdhesion"
length="4" size="4" value="2004"
onkeypress="onkeypress_field(event,"java.lang.String",this)"
onmouseout="onmouseout_field(event,"java.lang.String",this)" onmouseover="onmouseover_field(event,"java.lang.String",this)"
onblur="onblur_field(event,"java.lang.String",this)">
</td>
</tr>
</table>
</center>
</form>
</body>
</html>
If I specifiy a width, the method is not executed and if I don't
specify it, the method is executed.
Does anyone have an answer for that strange behaviour, and a solution
if i want to keep the width value. I tried with a style and javascript
and that doesn't work.
Thanks in advance.