Evo mog koda:
Znaci INPUT polje pri "onchange" poziva funkciju doCheckFirstName(), a onda pored polja gde korisnik upisuje ime, nalazi se jos jedan <td> u kome je buffer .... javlja da li je uneseno ime KOREKTNO (OK) ili NIJE (ERROR);
Formular:
Code:
<tr>
<td class="formular">Last Name </td>
<td class="formular">
<input class="myBox" type="text" name="lastName" tabindex="4" id="idLastName" onchange="doCheckLastName();"/></td>
<td class="formular" id="bufferLastName"><img src="../../bilder/new/checkAsterisk.jpg" alt="" width="50" height="18" /></td>
</tr>
<tr>
<td class="formular">Last Name </td>
<td class="formular">
<input class="myBox" type="text" name="lastName" tabindex="4" id="idLastName" onchange="doCheckLastName();"/></td>
<td class="formular" id="bufferLastName"><img src="../../bilder/new/checkAsterisk.jpg" alt="" width="50" height="18" /></td>
</tr>
JavaScript:
Code:
function doCheckLastName() {
buf = document.getElementById("bufferLastName");
if(isCharacter(document.getElementById("lastName").value)==false) {
buf.innerHTML = "<span style=\"color:#fd0101; font-size:17px;\">Error</span>";
}
else if(document.getElementById("lastName").value == "") {
buf.innerHTML = "<img src=\"/bilder/new/checkAsterisk.jpg\" width=\"50\" height=\"18\" />";
}
else {
buf.innerHTML = "<span style=\"color:#0033CC; font-size:17px;\">Ok</span>";
}
}
function doCheckLastName() {
buf = document.getElementById("bufferLastName");
if(isCharacter(document.getElementById("lastName").value)==false) {
buf.innerHTML = "<span style=\"color:#fd0101; font-size:17px;\">Error</span>";
}
else if(document.getElementById("lastName").value == "") {
buf.innerHTML = "<img src=\"/bilder/new/checkAsterisk.jpg\" width=\"50\" height=\"18\" />";
}
else {
buf.innerHTML = "<span style=\"color:#0033CC; font-size:17px;\">Ok</span>";
}
}
Sta trebam promeniti da radi i u Firefoxu?
hvala unapred