TobiasKlepp: document.write

Beitrag lesen

Hallo zusammen,

damit mein Problem klarer wird, der Quellcode:

<table width="100%" border="0" cellspacing="2" cellpadding="2">
<form name="login" method="post" action="<?php echo $url ?>login.php" onSubmit="return checkForm()">
<tr>
<td class="field-label" width="150" align="right">Benutzername</td>
<td>
<input class="field" type="text" name="login_name" size="25" maxlength="50" value="<?php echo $_COOKIE["save_name"] ?>">
</td>
</tr>

<script type="text/javascript">
<!--
function showMessage0() {
 document.write("<tr>");
 document.write("<td align="right"> </td>");
 document.write("<td class="error">^ Dein eingegebener Benutzername ist unbekannt!</td>");
 document.write("</tr>");
}
//-->
</script>

<tr>
<td class="field-label" align="right">Passwort</td>
<td><input class="field" type="password" name="login_password" size="25" maxlength="25" value=""></td>
</tr>

<tr>
<td align="right"> </td>
<td><input type="checkbox" name="save_name" value="1"<?php if ($_COOKIE["save_name"]) echo " checked" ?>>Benutzername speichern</td>
</tr>

<script type="text/javascript">
<!--
function showMessage1() {
 document.write("<tr>");
 document.write("<td align="right"> </td>");
 document.write("<td class="error">^ Bitte gib dein Passwort ein!</td>");
 document.write("</tr>");
}
//-->
</script>

<tr>
<td align="right">

<script language="JavaScript">
<!--
formsubmit = false;

function checkForm() {
 if(document.login.login_name.value == "") {
  showMessage0();
  document.login.login_name.focus();
  return false;
 }
 if(document.login.login_password.value == "") {
  showMessage1();
  document.login.login_password.focus();
  return false;
    }
}
//-->
</script>

</td>
<td><input type="submit" name="send" value="einloggen"></td>
</tr>
</form>
</table>