Avatar billede dotcom1 Nybegynder
20. juli 2004 - 22:38 Der er 21 kommentarer og
1 løsning

Cursot i formfelt

For at placere cursoren i et givent formfelt i en mailform skrives dette: <body onload="document.formnavn.navn.focus()"> Det virker og cursoren blinker det rigtige sted. Jeg får imidlertid fejlen: "'document.formnavn.navn' er null eller ikke et object" _efter_ afsendelse af en mail fra formen...men den når fint frem. Hvorfor får jeg denne fejl?

Koden kan ses her: http://www.studenterforum.dk/test/view_source.php

og evt. afprøves her: http://www.studenterforum.dk/test/formmail.php

Mvh.
Avatar billede syvon Nybegynder
20. juli 2004 - 22:52 #1
fejlen ligger vel i at når du har sendt besked vises formen ikke mere. derfor fejlen da den ikke har noget sted at placere cursoren
Avatar billede dotcom1 Nybegynder
20. juli 2004 - 22:58 #2
Nåh ja, du har ret. Kan man umiddelbart gøre noget for at rette det?
Avatar billede syvon Nybegynder
20. juli 2004 - 23:01 #3
man burde vel egentligt sætte denne ind sammen med den text der skal vises

<input type="text" name="navn" style="width:1px;visibility:hidden;">
Avatar billede dotcom1 Nybegynder
20. juli 2004 - 23:03 #4
Ok. Hvad præcis gør style="width:1px;visibility:hidden;"?
Avatar billede syvon Nybegynder
20. juli 2004 - 23:04 #5
widht laver den bare så den ikke fylder i breden

og visibility:hidden; skjuler den så den ikke kan ses.
Avatar billede dotcom1 Nybegynder
20. juli 2004 - 23:07 #6
Men hvis jeg tilføjer det til navnefeltet, så kan man jo ikke indtaste sit navn? Feltet skjules før formen er submittet...?
Avatar billede syvon Nybegynder
20. juli 2004 - 23:27 #7
prøv denne

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta name="Generator" content="Stone's WebWriter 4">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta http-equiv="imagetoolbar" content="no">
<title>Studenterforum.dk</title>
<link href="webstyles.css" rel="stylesheet" type="text/css">
</head>

<body bgcolor="#F7F0E8" leftmargin="0" topmargin="0" bottommargin="0" marginwidth="0" marginheight="0" onLoad="document.formnavn.navn.focus()">
<table width="710" align="center" cellpadding="0" cellspacing="0" style="height:100%;">
  <tr>
    <td width="710" height="606" colspan="3" bgcolor="#FFFFFF" style="vertical-align:top; padding-top:15px;"><table width="100%" border="0" align="center" style="height:29px;">
      <tr>
        <td width="40%" style="background-image:url(grafik/titel.jpg);background-repeat:no-repeat; border-right:1px dotted #999999;">&nbsp;</td>
        <td width="60%" style="padding-left:15px;padding-right:40px;text-align:left;"><span class="overskrift_sort">Studenterforum.dk er et websted for Spaniens- og Latinamerikainteresserede, hvor man kan l&aelig;se om forskellige emner,<br>
        samt f&aring; inspiration til opgaver. </span></td>
      </tr>
    </table>
    <br>
    <table width="100%" border="0" align="center" style="height:30px;">
      <tr>
        <td><table width="696" align="center" border="4" cellspacing="0" bordercolor="#FFFFFF" class="menu" style="height:30px;border-collapse:collapse; padding:0px; display:block;">
          <tr>
            <td width="18%" bgcolor="#FF950D" style="border:4px;cursor:pointer;"><a href="index.htm" class="menu">&nbsp;Forside</a></td>
            <td width="18%" bgcolor="#D6C482" style="border:4px;cursor:pointer;"><a href="opgaver/opgaver.php" class="menu">&nbsp;Opgaver</a></td>
            <td width="18%" bgcolor="#82ACD6" style="border:4px;cursor:pointer;"><a href="links.php" class="menu">&nbsp;Links</a></td>
            <td width="18%" bgcolor="#A2C488" style="border:4px;cursor:pointer;"><a href="formmail.php" class="menu">&nbsp;Kontakt</a></td>
          </tr>
        </table></td>
        </tr>
    </table>
      <table width="690" border="0" align="center" style="height:170px;vertical-align:top; padding-top:3px;">
        <tr>
          <td height="170"><img src="/test/grafik/forsidebillede.jpg" width="688" height="170" align="top"></td>
        </tr>
      </table>
      <table width="690" border="0" cellpadding="0" align="center" style="background-color:#F7F3EF; height:70px; background-image:url(grafik/border.jpg); background-position:bottom; background-repeat:no-repeat;">
        <tr>
          <td width="210">&nbsp;</td>
          <td width="169">&nbsp;</td>
          <td width="150" align="center">&nbsp;</td>
          <td width="150" align="center">&nbsp;</td>
        </tr>
      </table>
      <table width="690" border="0" cellpadding="0" align="center" style="background-color:#EBDFCF; height:300px;">
        <tr>
          <td valign="top" style=" padding-top:20px;"><table width="670" border="0" cellpadding="0" align="center" style="height:180px; border-left:1px dotted #999999;">
            <tr>
              <td width="517" style="border-bottom:1px dotted #999999; height:39px;"><table width="310" border="0" align="center">
                <tr>
                  <td class="midtertekst">Test af skrifttype og farve... kontakt </td>
                </tr>
              </table></td>
              <td width="146" style="border-left:1px dotted #999999;border-bottom:1px dotted #999999;">&nbsp;</td>
            </tr>
            <tr>
              <td valign="top" style="padding-top:5px;"><table width="95%" height="79"  border="0" align="center">
                <tr>
                  <td><?php
// Your e-mail adress:
$mailto = "webmaster@studenterforum.dk";

# Maximum size of attachment in bytes:
$max_attach_size = 500000;

?>
<style type="text/css">
<!--
.caution { color: red; font-weight: bold; }
-->
</style>
<?php
/*if (empty($_POST['form_submitted']))
{
  ?>
<p>Please fill out the form:</p><?php
}
*/
if (isset($_POST["form_submitted"]))
{
  $name = $_POST['name'];
  $email = $_POST['email'];
  $subject = $_POST['subject'];
  $text = $_POST['text'];

  unset($errors);
  if ($email != "" and !preg_match("/^[^@]+@.+\.\D{2,5}$/", $email)) $errors[] = "Angiv venligst en gyldig e-mailadresse";
  if ($text == "") $errors[] = "Indtast venligst en besked";
  if ($_FILES['probe']['size'] > $max_attach_size) $errors[] = "attachment too large (".number_format($_FILES['probe']['size']/1000,0,",","")." KB) - maximum size: ".number_format($max_attach_size/1000,0,",","")." KB";

  if (empty($errors))
  {
    $text = stripslashes($text);
    $subject = stripslashes($subject);
    if ($name != "") $mail_name=$name; else $mail_name="Unknown";
    if ($subject != "") $mail_subject = $subject; else $mail_subject = "Fra Studenterforum - No subject";
    if ($email != "") $mail_email = $email; else $mail_email = "email@unknown.xyz";
    $ip = $_SERVER["REMOTE_ADDR"];

    // if attachment, MIME-Mail:
    if (isset($_FILES['probe']['name']) && trim($_FILES['probe']['name']) != "")
    {
      // read and encode file:
      $datei_content = fread(fopen($_FILES['probe']['tmp_name'],"r"),filesize($_FILES['probe']['tmp_name']));
      $datei_content = chunk_split(base64_encode($datei_content),76,"\n");
      // Boundary:
      $boundary = md5(uniqid(rand()));
      // Mail-Header:
      $mail_header = "From: ".$mail_name." <".$mail_email.">\n";
      $mail_header .= "X-Sender-IP: ".$ip."\n";
      $mail_header .= "MIME-Version: 1.0\n";
      $mail_header .= "Content-Type: multipart/mixed; boundary=\"".$boundary."\"\n";
      $mail_header .= "This is a multi-part message in MIME format.\n";
      // Mail-Text:
      $mail_header .= "--".$boundary;
      $mail_header .= "\nContent-Type: text/plain";
      $mail_header .= "\nContent-Transfer-Encoding: 8bit";
      $mail_header .= "\n\n".$text;
      // Attachment:
      $mail_header .= "\n--".$boundary;
      $mail_header .= "\nContent-Type: ".$_FILES['probe']['type']."; name=\"".$_FILES['probe']['name']."\"";
      $mail_header .= "\nContent-Transfer-Encoding: base64";
      $mail_header .= "\nContent-Disposition: attachment; filename=\"".$_FILES['probe']['name']."\"";
      $mail_header .= "\n\n".$datei_content;
      // End:
      $mail_header .= "\n--".$boundary."--";
      // Sende E-Mail und gebe Fehler bzw. Bestaetigung aus
      if (@mail($mailto,$mail_subject,"",$mail_header)) $sent = true; else $errors[] = "no connection to the mailserver - please try again later";
    }
    // no attachment, normal E-mail:
    else
    {
      $mail_header = "From: ".$mail_name." <".$mail_email.">\n";
      $mail_header .= "X-Sender-IP: $ip\n";
      $mail_header .= "Content-Type: text/plain";
      if (@mail($mailto,$mail_subject,$text,$mail_header)) $sent = true; else $errors[] = "no connection to the mailserver - please try again later";
    }

    // copy to sender:
    if (isset($sent) && isset($email) && $email != "" && isset($_POST['copy']))
    {
      if (isset($_FILES['probe']['name']) && trim($_FILES['probe']['name']) != "") $copy_mail_text = "Copy of the e-mail:\n\n".$text."\n\nAttachment: ".$_FILES['probe']['name']; else $copy_mail_text = "Copy of the e-mail:\n\n".$text;
      $header= "From: ".$mailto."\n";
      $header .= "X-Sender-IP: ".$ip."\n";
      $header .= "Content-Type: text/plain";
      @mail($email, $mail_subject, $copy_mail_text, $header);
    }
  }
}

if (empty($sent))
{
  if(isset($errors))
  {
    ?><p class="caution">Error:</p><ul><?php foreach($errors as $f) { ?><li><?php echo $f; ?></li><?php } ?></ul><br /><?php
  }

  ?><form name="formnavn" form method="post" action="<?php echo basename($_SERVER["PHP_SELF"]); ?>" enctype="multipart/form-data"><div>
  <p>Navn:<br />
    <input type="text" name="navn" style="border: 1px solid #999999;" value="<?php if (isset($name)) echo htmlentities(stripslashes($name)); else echo ""; ?>" size="35" /></p>
  <p>E-mail:<br /><input type="text" name="email" style="border: 1px solid #999999;" value="<?php if (isset($email)) echo htmlentities(stripslashes($email)); else echo ""; ?>" size="35" /></p>
  <p>Emne:<br /><input type="text" name="subject" style="border: 1px solid #999999;" value="<?php if (isset($subject)) echo htmlentities(stripslashes($subject)); else echo ""; ?>" size="35" /></p>
  Besked:<br />
  <textarea name="text" cols="45" rows="8" style="border: 1px solid #999999;"><?php if (isset($text)) echo htmlentities(stripslashes($text)); else echo ""; ?>
  </textarea>
  <br>
  <br>

  Attachment:<br /><input type="file" name="probe" style="border: 1px solid #999999;cursor:pointer;" value="<?php if (isset($_POST['probe'])) echo htmlentities(stripslashes($_POST['probe'])); else echo ""; ?>" size="20"/></p>
  <br />
  <p><input type="submit" style="border: 1px solid #999999; cursor:pointer;" name="form_submitted" class="submit_knap" value="OK - Send" />&nbsp;&nbsp;&nbsp; <input type="checkbox" name="copy" value="true" /> Send kopi til afsender</p>
  </div>
  <p><br /><b>Tak!</b><input value="<?php echo "$name"; ?>" disabled="disabled" readonly="readonly" name="name" style="border:0;"><br />
    Beskeden er sendt, men da du ikke angav en e-mailadresse, kan vi ikke besvare din henvendelse.<br />
    .</p>
</form><?php
}
else
{
  if (empty($email)) { ?>
  <p><br /><b>Tak!</b><input value="<?php echo "$name"; ?>" disabled="disabled" readonly="readonly" name="name" style="border:0;"><br />
    Beskeden er sendt, men da du ikke angav en e-mailadresse, kan vi ikke besvare din henvendelse.<br />
    .</p>
  <?php }
  else { ?><p><b>Tak!</b><input value="<?php echo "$name"; ?>" disabled="disabled" readonly="readonly" name="name"><br />
Beskeden er sendt.<br />
</p>
  <?php }
}

// If you want to remove the Link please donate some Euros:
// http://www.mylittlehomepage.net/donation.html

?><p style="font-size: 9px; color:#999999">Script by <a class="plain" href="http://www.mylittlehomepage.net/">Alex</a></td>
                </tr>
              </table>
                </td>
              <td valign="top" style="border-left:1px dotted #999999;">
                <table width="92%" border="0" align="center" style="height:15px; vertical-align:top;">
                  <tr>
                    <td valign="top" class="sidemenu" style="text-align:left;">
                        <br>
                        <img src="grafik/arrow.jpg" width="14" height="11"><a class="sidemenu" href="om.php">Om Studenterforum</a><br>
                        <br>
                        <img src="grafik/arrow.jpg" width="14" height="11"><a class="sidemenu" href="redaktion.php">Redaktionen</a><br>
                        <br>
                        <img src="grafik/arrow.jpg" width="14" height="11"><a class="sidemenu" href="#">Anbefal til en ven </a></td>
                  </tr>
                </table>
              </td>
            </tr>
          </table>
          <br></td>
        </tr>
    </table></td>
  </tr>
  <tr>
    <td height="15" colspan="3" bgcolor="#FFFFFF" style="vertical-align:top;">&nbsp;</td>
  </tr>
</table>
</body>
</html>
Avatar billede syvon Nybegynder
20. juli 2004 - 23:33 #8
der var lige sneget sig en fejl ind prøv denne istedet

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta name="Generator" content="Stone's WebWriter 4">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta http-equiv="imagetoolbar" content="no">
<title>Studenterforum.dk</title>
<link href="webstyles.css" rel="stylesheet" type="text/css">
</head>

<body bgcolor="#F7F0E8" leftmargin="0" topmargin="0" bottommargin="0" marginwidth="0" marginheight="0" onLoad="document.formnavn.navn.focus()">
<table width="710" align="center" cellpadding="0" cellspacing="0" style="height:100%;">
  <tr>
    <td width="710" height="606" colspan="3" bgcolor="#FFFFFF" style="vertical-align:top; padding-top:15px;"><table width="100%" border="0" align="center" style="height:29px;">
      <tr>
        <td width="40%" style="background-image:url(grafik/titel.jpg);background-repeat:no-repeat; border-right:1px dotted #999999;">&nbsp;</td>
        <td width="60%" style="padding-left:15px;padding-right:40px;text-align:left;"><span class="overskrift_sort">Studenterforum.dk er et websted for Spaniens- og Latinamerikainteresserede, hvor man kan l&aelig;se om forskellige emner,<br>
        samt f&aring; inspiration til opgaver. </span></td>
      </tr>
    </table>
    <br>
    <table width="100%" border="0" align="center" style="height:30px;">
      <tr>
        <td><table width="696" align="center" border="4" cellspacing="0" bordercolor="#FFFFFF" class="menu" style="height:30px;border-collapse:collapse; padding:0px; display:block;">
          <tr>
            <td width="18%" bgcolor="#FF950D" style="border:4px;cursor:pointer;"><a href="index.htm" class="menu">&nbsp;Forside</a></td>
            <td width="18%" bgcolor="#D6C482" style="border:4px;cursor:pointer;"><a href="opgaver/opgaver.php" class="menu">&nbsp;Opgaver</a></td>
            <td width="18%" bgcolor="#82ACD6" style="border:4px;cursor:pointer;"><a href="links.php" class="menu">&nbsp;Links</a></td>
            <td width="18%" bgcolor="#A2C488" style="border:4px;cursor:pointer;"><a href="formmail.php" class="menu">&nbsp;Kontakt</a></td>
          </tr>
        </table></td>
        </tr>
    </table>
      <table width="690" border="0" align="center" style="height:170px;vertical-align:top; padding-top:3px;">
        <tr>
          <td height="170"><img src="/test/grafik/forsidebillede.jpg" width="688" height="170" align="top"></td>
        </tr>
      </table>
      <table width="690" border="0" cellpadding="0" align="center" style="background-color:#F7F3EF; height:70px; background-image:url(grafik/border.jpg); background-position:bottom; background-repeat:no-repeat;">
        <tr>
          <td width="210">&nbsp;</td>
          <td width="169">&nbsp;</td>
          <td width="150" align="center">&nbsp;</td>
          <td width="150" align="center">&nbsp;</td>
        </tr>
      </table>
      <table width="690" border="0" cellpadding="0" align="center" style="background-color:#EBDFCF; height:300px;">
        <tr>
          <td valign="top" style=" padding-top:20px;"><table width="670" border="0" cellpadding="0" align="center" style="height:180px; border-left:1px dotted #999999;">
            <tr>
              <td width="517" style="border-bottom:1px dotted #999999; height:39px;"><table width="310" border="0" align="center">
                <tr>
                  <td class="midtertekst">Test af skrifttype og farve... kontakt </td>
                </tr>
              </table></td>
              <td width="146" style="border-left:1px dotted #999999;border-bottom:1px dotted #999999;">&nbsp;</td>
            </tr>
            <tr>
              <td valign="top" style="padding-top:5px;"><table width="95%" height="79"  border="0" align="center">
                <tr>
                  <td><?php
// Your e-mail adress:
$mailto = "webmaster@studenterforum.dk";

# Maximum size of attachment in bytes:
$max_attach_size = 500000;

?>
<style type="text/css">
<!--
.caution { color: red; font-weight: bold; }
-->
</style>
<?php
/*if (empty($_POST['form_submitted']))
{
  ?>
<p>Please fill out the form:</p><?php
}
*/
if (isset($_POST["form_submitted"]))
{
  $name = $_POST['name'];
  $email = $_POST['email'];
  $subject = $_POST['subject'];
  $text = $_POST['text'];

  unset($errors);
  if ($email != "" and !preg_match("/^[^@]+@.+\.\D{2,5}$/", $email)) $errors[] = "Angiv venligst en gyldig e-mailadresse";
  if ($text == "") $errors[] = "Indtast venligst en besked";
  if ($_FILES['probe']['size'] > $max_attach_size) $errors[] = "attachment too large (".number_format($_FILES['probe']['size']/1000,0,",","")." KB) - maximum size: ".number_format($max_attach_size/1000,0,",","")." KB";

  if (empty($errors))
  {
    $text = stripslashes($text);
    $subject = stripslashes($subject);
    if ($name != "") $mail_name=$name; else $mail_name="Unknown";
    if ($subject != "") $mail_subject = $subject; else $mail_subject = "Fra Studenterforum - No subject";
    if ($email != "") $mail_email = $email; else $mail_email = "email@unknown.xyz";
    $ip = $_SERVER["REMOTE_ADDR"];

    // if attachment, MIME-Mail:
    if (isset($_FILES['probe']['name']) && trim($_FILES['probe']['name']) != "")
    {
      // read and encode file:
      $datei_content = fread(fopen($_FILES['probe']['tmp_name'],"r"),filesize($_FILES['probe']['tmp_name']));
      $datei_content = chunk_split(base64_encode($datei_content),76,"\n");
      // Boundary:
      $boundary = md5(uniqid(rand()));
      // Mail-Header:
      $mail_header = "From: ".$mail_name." <".$mail_email.">\n";
      $mail_header .= "X-Sender-IP: ".$ip."\n";
      $mail_header .= "MIME-Version: 1.0\n";
      $mail_header .= "Content-Type: multipart/mixed; boundary=\"".$boundary."\"\n";
      $mail_header .= "This is a multi-part message in MIME format.\n";
      // Mail-Text:
      $mail_header .= "--".$boundary;
      $mail_header .= "\nContent-Type: text/plain";
      $mail_header .= "\nContent-Transfer-Encoding: 8bit";
      $mail_header .= "\n\n".$text;
      // Attachment:
      $mail_header .= "\n--".$boundary;
      $mail_header .= "\nContent-Type: ".$_FILES['probe']['type']."; name=\"".$_FILES['probe']['name']."\"";
      $mail_header .= "\nContent-Transfer-Encoding: base64";
      $mail_header .= "\nContent-Disposition: attachment; filename=\"".$_FILES['probe']['name']."\"";
      $mail_header .= "\n\n".$datei_content;
      // End:
      $mail_header .= "\n--".$boundary."--";
      // Sende E-Mail und gebe Fehler bzw. Bestaetigung aus
      if (@mail($mailto,$mail_subject,"",$mail_header)) $sent = true; else $errors[] = "no connection to the mailserver - please try again later";
    }
    // no attachment, normal E-mail:
    else
    {
      $mail_header = "From: ".$mail_name." <".$mail_email.">\n";
      $mail_header .= "X-Sender-IP: $ip\n";
      $mail_header .= "Content-Type: text/plain";
      if (@mail($mailto,$mail_subject,$text,$mail_header)) $sent = true; else $errors[] = "no connection to the mailserver - please try again later";
    }

    // copy to sender:
    if (isset($sent) && isset($email) && $email != "" && isset($_POST['copy']))
    {
      if (isset($_FILES['probe']['name']) && trim($_FILES['probe']['name']) != "") $copy_mail_text = "Copy of the e-mail:\n\n".$text."\n\nAttachment: ".$_FILES['probe']['name']; else $copy_mail_text = "Copy of the e-mail:\n\n".$text;
      $header= "From: ".$mailto."\n";
      $header .= "X-Sender-IP: ".$ip."\n";
      $header .= "Content-Type: text/plain";
      @mail($email, $mail_subject, $copy_mail_text, $header);
    }
  }
}

if (empty($sent))
{
  if(isset($errors))
  {
    ?><p class="caution">Error:</p><ul><?php foreach($errors as $f) { ?><li><?php echo $f; ?></li><?php } ?></ul><br /><?php
  }

  ?><form name="formnavn" form method="post" action="<?php echo basename($_SERVER["PHP_SELF"]); ?>" enctype="multipart/form-data"><div>
  <p>Navn:<br />
    <input type="text" name="navn" style="border: 1px solid #999999;" value="<?php if (isset($name)) echo htmlentities(stripslashes($name)); else echo ""; ?>" size="35" /></p>
  <p>E-mail:<br /><input type="text" name="email" style="border: 1px solid #999999;" value="<?php if (isset($email)) echo htmlentities(stripslashes($email)); else echo ""; ?>" size="35" /></p>
  <p>Emne:<br /><input type="text" name="subject" style="border: 1px solid #999999;" value="<?php if (isset($subject)) echo htmlentities(stripslashes($subject)); else echo ""; ?>" size="35" /></p>
  Besked:<br />
  <textarea name="text" cols="45" rows="8" style="border: 1px solid #999999;"><?php if (isset($text)) echo htmlentities(stripslashes($text)); else echo ""; ?>
  </textarea>
  <br>
  <br>

  Attachment:<br /><input type="file" name="probe" style="border: 1px solid #999999;cursor:pointer;" value="<?php if (isset($_POST['probe'])) echo htmlentities(stripslashes($_POST['probe'])); else echo ""; ?>" size="20"/></p>
  <br />
  <p><input type="submit" style="border: 1px solid #999999; cursor:pointer;" name="form_submitted" class="submit_knap" value="OK - Send" />&nbsp;&nbsp;&nbsp; <input type="checkbox" name="copy" value="true" /> Send kopi til afsender</p>
  </div>
</form><?php
}
else
{
  if (empty($email)) { ?>
  <p><br /><b>Tak!</b><input type="hidden" disabled="disabled" readonly="readonly" name="name"><br />
    Beskeden er sendt, men da du ikke angav en e-mailadresse, kan vi ikke besvare din henvendelse.<br />
    .</p>
  <?php }
  else { ?><p><b>Tak!</b><input type="hidden" value="name" disabled="disabled"" name="name"><br />
Beskeden er sendt.<br />
</p>
  <?php }
}

// If you want to remove the Link please donate some Euros:
// http://www.mylittlehomepage.net/donation.html

?><p style="font-size: 9px; color:#999999">Script by <a class="plain" href="http://www.mylittlehomepage.net/">Alex</a></td>
                </tr>
              </table>
                </td>
              <td valign="top" style="border-left:1px dotted #999999;">
                <table width="92%" border="0" align="center" style="height:15px; vertical-align:top;">
                  <tr>
                    <td valign="top" class="sidemenu" style="text-align:left;">
                        <br>
                        <img src="grafik/arrow.jpg" width="14" height="11"><a class="sidemenu" href="om.php">Om Studenterforum</a><br>
                        <br>
                        <img src="grafik/arrow.jpg" width="14" height="11"><a class="sidemenu" href="redaktion.php">Redaktionen</a><br>
                        <br>
                        <img src="grafik/arrow.jpg" width="14" height="11"><a class="sidemenu" href="#">Anbefal til en ven </a></td>
                  </tr>
                </table>
              </td>
            </tr>
          </table>
          <br></td>
        </tr>
    </table></td>
  </tr>
  <tr>
    <td height="15" colspan="3" bgcolor="#FFFFFF" style="vertical-align:top;">&nbsp;</td>
  </tr>
</table>
</body>
</html>
Avatar billede dotcom1 Nybegynder
20. juli 2004 - 23:49 #9
Den melder stadig at der opstod en fejl på siden efter afsendelse af en mail...
Avatar billede syvon Nybegynder
20. juli 2004 - 23:53 #10
så prøv denne

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta name="Generator" content="Stone's WebWriter 4">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta http-equiv="imagetoolbar" content="no">
<title>Studenterforum.dk</title>
<link href="webstyles.css" rel="stylesheet" type="text/css">
</head>

<body bgcolor="#F7F0E8" leftmargin="0" topmargin="0" bottommargin="0" marginwidth="0" marginheight="0" onLoad="document.formnavn.navn.focus()">
<table width="710" align="center" cellpadding="0" cellspacing="0" style="height:100%;">
  <tr>
    <td width="710" height="606" colspan="3" bgcolor="#FFFFFF" style="vertical-align:top; padding-top:15px;"><table width="100%" border="0" align="center" style="height:29px;">
      <tr>
        <td width="40%" style="background-image:url(grafik/titel.jpg);background-repeat:no-repeat; border-right:1px dotted #999999;">&nbsp;</td>
        <td width="60%" style="padding-left:15px;padding-right:40px;text-align:left;"><span class="overskrift_sort">Studenterforum.dk er et websted for Spaniens- og Latinamerikainteresserede, hvor man kan l&aelig;se om forskellige emner,<br>
        samt f&aring; inspiration til opgaver. </span></td>
      </tr>
    </table>
    <br>
    <table width="100%" border="0" align="center" style="height:30px;">
      <tr>
        <td><table width="696" align="center" border="4" cellspacing="0" bordercolor="#FFFFFF" class="menu" style="height:30px;border-collapse:collapse; padding:0px; display:block;">
          <tr>
            <td width="18%" bgcolor="#FF950D" style="border:4px;cursor:pointer;"><a href="index.htm" class="menu">&nbsp;Forside</a></td>
            <td width="18%" bgcolor="#D6C482" style="border:4px;cursor:pointer;"><a href="opgaver/opgaver.php" class="menu">&nbsp;Opgaver</a></td>
            <td width="18%" bgcolor="#82ACD6" style="border:4px;cursor:pointer;"><a href="links.php" class="menu">&nbsp;Links</a></td>
            <td width="18%" bgcolor="#A2C488" style="border:4px;cursor:pointer;"><a href="formmail.php" class="menu">&nbsp;Kontakt</a></td>
          </tr>
        </table></td>
        </tr>
    </table>
      <table width="690" border="0" align="center" style="height:170px;vertical-align:top; padding-top:3px;">
        <tr>
          <td height="170"><img src="/test/grafik/forsidebillede.jpg" width="688" height="170" align="top"></td>
        </tr>
      </table>
      <table width="690" border="0" cellpadding="0" align="center" style="background-color:#F7F3EF; height:70px; background-image:url(grafik/border.jpg); background-position:bottom; background-repeat:no-repeat;">
        <tr>
          <td width="210">&nbsp;</td>
          <td width="169">&nbsp;</td>
          <td width="150" align="center">&nbsp;</td>
          <td width="150" align="center">&nbsp;</td>
        </tr>
      </table>
      <table width="690" border="0" cellpadding="0" align="center" style="background-color:#EBDFCF; height:300px;">
        <tr>
          <td valign="top" style=" padding-top:20px;"><table width="670" border="0" cellpadding="0" align="center" style="height:180px; border-left:1px dotted #999999;">
            <tr>
              <td width="517" style="border-bottom:1px dotted #999999; height:39px;"><table width="310" border="0" align="center">
                <tr>
                  <td class="midtertekst">Test af skrifttype og farve... kontakt </td>
                </tr>
              </table></td>
              <td width="146" style="border-left:1px dotted #999999;border-bottom:1px dotted #999999;">&nbsp;</td>
            </tr>
            <tr>
              <td valign="top" style="padding-top:5px;"><table width="95%" height="79"  border="0" align="center">
                <tr>
                  <td><?php
// Your e-mail adress:
$mailto = "webmaster@studenterforum.dk";

# Maximum size of attachment in bytes:
$max_attach_size = 500000;

?>
<style type="text/css">
<!--
.caution { color: red; font-weight: bold; }
-->
</style>
<?php
/*if (empty($_POST['form_submitted']))
{
  ?>
<p>Please fill out the form:</p><?php
}
*/
if (isset($_POST["form_submitted"]))
{
  $name = $_POST['name'];
  $email = $_POST['email'];
  $subject = $_POST['subject'];
  $text = $_POST['text'];

  unset($errors);
  if ($email != "" and !preg_match("/^[^@]+@.+\.\D{2,5}$/", $email)) $errors[] = "Angiv venligst en gyldig e-mailadresse";
  if ($text == "") $errors[] = "Indtast venligst en besked";
  if ($_FILES['probe']['size'] > $max_attach_size) $errors[] = "attachment too large (".number_format($_FILES['probe']['size']/1000,0,",","")." KB) - maximum size: ".number_format($max_attach_size/1000,0,",","")." KB";

  if (empty($errors))
  {
    $text = stripslashes($text);
    $subject = stripslashes($subject);
    if ($name != "") $mail_name=$name; else $mail_name="Unknown";
    if ($subject != "") $mail_subject = $subject; else $mail_subject = "Fra Studenterforum - No subject";
    if ($email != "") $mail_email = $email; else $mail_email = "email@unknown.xyz";
    $ip = $_SERVER["REMOTE_ADDR"];

    // if attachment, MIME-Mail:
    if (isset($_FILES['probe']['name']) && trim($_FILES['probe']['name']) != "")
    {
      // read and encode file:
      $datei_content = fread(fopen($_FILES['probe']['tmp_name'],"r"),filesize($_FILES['probe']['tmp_name']));
      $datei_content = chunk_split(base64_encode($datei_content),76,"\n");
      // Boundary:
      $boundary = md5(uniqid(rand()));
      // Mail-Header:
      $mail_header = "From: ".$mail_name." <".$mail_email.">\n";
      $mail_header .= "X-Sender-IP: ".$ip."\n";
      $mail_header .= "MIME-Version: 1.0\n";
      $mail_header .= "Content-Type: multipart/mixed; boundary=\"".$boundary."\"\n";
      $mail_header .= "This is a multi-part message in MIME format.\n";
      // Mail-Text:
      $mail_header .= "--".$boundary;
      $mail_header .= "\nContent-Type: text/plain";
      $mail_header .= "\nContent-Transfer-Encoding: 8bit";
      $mail_header .= "\n\n".$text;
      // Attachment:
      $mail_header .= "\n--".$boundary;
      $mail_header .= "\nContent-Type: ".$_FILES['probe']['type']."; name=\"".$_FILES['probe']['name']."\"";
      $mail_header .= "\nContent-Transfer-Encoding: base64";
      $mail_header .= "\nContent-Disposition: attachment; filename=\"".$_FILES['probe']['name']."\"";
      $mail_header .= "\n\n".$datei_content;
      // End:
      $mail_header .= "\n--".$boundary."--";
      // Sende E-Mail und gebe Fehler bzw. Bestaetigung aus
      if (@mail($mailto,$mail_subject,"",$mail_header)) $sent = true; else $errors[] = "no connection to the mailserver - please try again later";
    }
    // no attachment, normal E-mail:
    else
    {
      $mail_header = "From: ".$mail_name." <".$mail_email.">\n";
      $mail_header .= "X-Sender-IP: $ip\n";
      $mail_header .= "Content-Type: text/plain";
      if (@mail($mailto,$mail_subject,$text,$mail_header)) $sent = true; else $errors[] = "no connection to the mailserver - please try again later";
    }

    // copy to sender:
    if (isset($sent) && isset($email) && $email != "" && isset($_POST['copy']))
    {
      if (isset($_FILES['probe']['name']) && trim($_FILES['probe']['name']) != "") $copy_mail_text = "Copy of the e-mail:\n\n".$text."\n\nAttachment: ".$_FILES['probe']['name']; else $copy_mail_text = "Copy of the e-mail:\n\n".$text;
      $header= "From: ".$mailto."\n";
      $header .= "X-Sender-IP: ".$ip."\n";
      $header .= "Content-Type: text/plain";
      @mail($email, $mail_subject, $copy_mail_text, $header);
    }
  }
}

if (empty($sent))
{
  if(isset($errors))
  {
    ?><p class="caution">Error:</p><ul><?php foreach($errors as $f) { ?><li><?php echo $f; ?></li><?php } ?></ul><br /><?php
  }

  ?><form name="formnavn" form method="post" action="<?php echo basename($_SERVER["PHP_SELF"]); ?>" enctype="multipart/form-data"><div>
  <p>Navn:<br />
    <input type="text" name="navn" style="border: 1px solid #999999;" value="<?php if (isset($name)) echo htmlentities(stripslashes($name)); else echo ""; ?>" size="35" /></p>
  <p>E-mail:<br /><input type="text" name="email" style="border: 1px solid #999999;" value="<?php if (isset($email)) echo htmlentities(stripslashes($email)); else echo ""; ?>" size="35" /></p>
  <p>Emne:<br /><input type="text" name="subject" style="border: 1px solid #999999;" value="<?php if (isset($subject)) echo htmlentities(stripslashes($subject)); else echo ""; ?>" size="35" /></p>
  Besked:<br />
  <textarea name="text" cols="45" rows="8" style="border: 1px solid #999999;"><?php if (isset($text)) echo htmlentities(stripslashes($text)); else echo ""; ?>
  </textarea>
  <br>
  <br>

  Attachment:<br /><input type="file" name="probe" style="border: 1px solid #999999;cursor:pointer;" value="<?php if (isset($_POST['probe'])) echo htmlentities(stripslashes($_POST['probe'])); else echo ""; ?>" size="20"/></p>
  <br />
  <p><input type="submit" style="border: 1px solid #999999; cursor:pointer;" name="form_submitted" class="submit_knap" value="OK - Send" />&nbsp;&nbsp;&nbsp; <input type="checkbox" name="copy" value="true" /> Send kopi til afsender</p>
  </div>
</form><?php
}
else
{
  if (empty($email)) { ?>
  <p><br /><b>Tak!</b><input type="hidden" name="name"><br />
    Beskeden er sendt, men da du ikke angav en e-mailadresse, kan vi ikke besvare din henvendelse.<br />
    .</p>
  <?php }
  else { ?><p><b>Tak!</b><input type="hidden" name="name"><br />
Beskeden er sendt.<br />
</p>
  <?php }
}

// If you want to remove the Link please donate some Euros:
// http://www.mylittlehomepage.net/donation.html

?><p style="font-size: 9px; color:#999999">Script by <a class="plain" href="http://www.mylittlehomepage.net/">Alex</a></td>
                </tr>
              </table>
                </td>
              <td valign="top" style="border-left:1px dotted #999999;">
                <table width="92%" border="0" align="center" style="height:15px; vertical-align:top;">
                  <tr>
                    <td valign="top" class="sidemenu" style="text-align:left;">
                        <br>
                        <img src="grafik/arrow.jpg" width="14" height="11"><a class="sidemenu" href="om.php">Om Studenterforum</a><br>
                        <br>
                        <img src="grafik/arrow.jpg" width="14" height="11"><a class="sidemenu" href="redaktion.php">Redaktionen</a><br>
                        <br>
                        <img src="grafik/arrow.jpg" width="14" height="11"><a class="sidemenu" href="#">Anbefal til en ven </a></td>
                  </tr>
                </table>
              </td>
            </tr>
          </table>
          <br></td>
        </tr>
    </table></td>
  </tr>
  <tr>
    <td height="15" colspan="3" bgcolor="#FFFFFF" style="vertical-align:top;">&nbsp;</td>
  </tr>
</table>
</body>
</html>
Avatar billede dotcom1 Nybegynder
21. juli 2004 - 00:39 #11
Hmmm, det samme stadigvæk... Måske skulle jeg undvære onLoad="document.formnavn.navn.focus()"....
Avatar billede syvon Nybegynder
21. juli 2004 - 00:45 #12
det skulle kunne lade sig gøre

men det kræver nok at der bliver lavet en form uden om dit input

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta name="Generator" content="Stone's WebWriter 4">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta http-equiv="imagetoolbar" content="no">
<title>Studenterforum.dk</title>
<link href="webstyles.css" rel="stylesheet" type="text/css">
</head>

<body bgcolor="#F7F0E8" leftmargin="0" topmargin="0" bottommargin="0" marginwidth="0" marginheight="0" onLoad="document.formnavn.navn.focus()">
<table width="710" align="center" cellpadding="0" cellspacing="0" style="height:100%;">
  <tr>
    <td width="710" height="606" colspan="3" bgcolor="#FFFFFF" style="vertical-align:top; padding-top:15px;"><table width="100%" border="0" align="center" style="height:29px;">
      <tr>
        <td width="40%" style="background-image:url(grafik/titel.jpg);background-repeat:no-repeat; border-right:1px dotted #999999;">&nbsp;</td>
        <td width="60%" style="padding-left:15px;padding-right:40px;text-align:left;"><span class="overskrift_sort">Studenterforum.dk er et websted for Spaniens- og Latinamerikainteresserede, hvor man kan l&aelig;se om forskellige emner,<br>
        samt f&aring; inspiration til opgaver. </span></td>
      </tr>
    </table>
    <br>
    <table width="100%" border="0" align="center" style="height:30px;">
      <tr>
        <td><table width="696" align="center" border="4" cellspacing="0" bordercolor="#FFFFFF" class="menu" style="height:30px;border-collapse:collapse; padding:0px; display:block;">
          <tr>
            <td width="18%" bgcolor="#FF950D" style="border:4px;cursor:pointer;"><a href="index.htm" class="menu">&nbsp;Forside</a></td>
            <td width="18%" bgcolor="#D6C482" style="border:4px;cursor:pointer;"><a href="opgaver/opgaver.php" class="menu">&nbsp;Opgaver</a></td>
            <td width="18%" bgcolor="#82ACD6" style="border:4px;cursor:pointer;"><a href="links.php" class="menu">&nbsp;Links</a></td>
            <td width="18%" bgcolor="#A2C488" style="border:4px;cursor:pointer;"><a href="formmail.php" class="menu">&nbsp;Kontakt</a></td>
          </tr>
        </table></td>
        </tr>
    </table>
      <table width="690" border="0" align="center" style="height:170px;vertical-align:top; padding-top:3px;">
        <tr>
          <td height="170"><img src="/test/grafik/forsidebillede.jpg" width="688" height="170" align="top"></td>
        </tr>
      </table>
      <table width="690" border="0" cellpadding="0" align="center" style="background-color:#F7F3EF; height:70px; background-image:url(grafik/border.jpg); background-position:bottom; background-repeat:no-repeat;">
        <tr>
          <td width="210">&nbsp;</td>
          <td width="169">&nbsp;</td>
          <td width="150" align="center">&nbsp;</td>
          <td width="150" align="center">&nbsp;</td>
        </tr>
      </table>
      <table width="690" border="0" cellpadding="0" align="center" style="background-color:#EBDFCF; height:300px;">
        <tr>
          <td valign="top" style=" padding-top:20px;"><table width="670" border="0" cellpadding="0" align="center" style="height:180px; border-left:1px dotted #999999;">
            <tr>
              <td width="517" style="border-bottom:1px dotted #999999; height:39px;"><table width="310" border="0" align="center">
                <tr>
                  <td class="midtertekst">Test af skrifttype og farve... kontakt </td>
                </tr>
              </table></td>
              <td width="146" style="border-left:1px dotted #999999;border-bottom:1px dotted #999999;">&nbsp;</td>
            </tr>
            <tr>
              <td valign="top" style="padding-top:5px;"><table width="95%" height="79"  border="0" align="center">
                <tr>
                  <td><?php
// Your e-mail adress:
$mailto = "webmaster@studenterforum.dk";

# Maximum size of attachment in bytes:
$max_attach_size = 500000;

?>
<style type="text/css">
<!--
.caution { color: red; font-weight: bold; }
-->
</style>
<?php
/*if (empty($_POST['form_submitted']))
{
  ?>
<p>Please fill out the form:</p><?php
}
*/
if (isset($_POST["form_submitted"]))
{
  $name = $_POST['name'];
  $email = $_POST['email'];
  $subject = $_POST['subject'];
  $text = $_POST['text'];

  unset($errors);
  if ($email != "" and !preg_match("/^[^@]+@.+\.\D{2,5}$/", $email)) $errors[] = "Angiv venligst en gyldig e-mailadresse";
  if ($text == "") $errors[] = "Indtast venligst en besked";
  if ($_FILES['probe']['size'] > $max_attach_size) $errors[] = "attachment too large (".number_format($_FILES['probe']['size']/1000,0,",","")." KB) - maximum size: ".number_format($max_attach_size/1000,0,",","")." KB";

  if (empty($errors))
  {
    $text = stripslashes($text);
    $subject = stripslashes($subject);
    if ($name != "") $mail_name=$name; else $mail_name="Unknown";
    if ($subject != "") $mail_subject = $subject; else $mail_subject = "Fra Studenterforum - No subject";
    if ($email != "") $mail_email = $email; else $mail_email = "email@unknown.xyz";
    $ip = $_SERVER["REMOTE_ADDR"];

    // if attachment, MIME-Mail:
    if (isset($_FILES['probe']['name']) && trim($_FILES['probe']['name']) != "")
    {
      // read and encode file:
      $datei_content = fread(fopen($_FILES['probe']['tmp_name'],"r"),filesize($_FILES['probe']['tmp_name']));
      $datei_content = chunk_split(base64_encode($datei_content),76,"\n");
      // Boundary:
      $boundary = md5(uniqid(rand()));
      // Mail-Header:
      $mail_header = "From: ".$mail_name." <".$mail_email.">\n";
      $mail_header .= "X-Sender-IP: ".$ip."\n";
      $mail_header .= "MIME-Version: 1.0\n";
      $mail_header .= "Content-Type: multipart/mixed; boundary=\"".$boundary."\"\n";
      $mail_header .= "This is a multi-part message in MIME format.\n";
      // Mail-Text:
      $mail_header .= "--".$boundary;
      $mail_header .= "\nContent-Type: text/plain";
      $mail_header .= "\nContent-Transfer-Encoding: 8bit";
      $mail_header .= "\n\n".$text;
      // Attachment:
      $mail_header .= "\n--".$boundary;
      $mail_header .= "\nContent-Type: ".$_FILES['probe']['type']."; name=\"".$_FILES['probe']['name']."\"";
      $mail_header .= "\nContent-Transfer-Encoding: base64";
      $mail_header .= "\nContent-Disposition: attachment; filename=\"".$_FILES['probe']['name']."\"";
      $mail_header .= "\n\n".$datei_content;
      // End:
      $mail_header .= "\n--".$boundary."--";
      // Sende E-Mail und gebe Fehler bzw. Bestaetigung aus
      if (@mail($mailto,$mail_subject,"",$mail_header)) $sent = true; else $errors[] = "no connection to the mailserver - please try again later";
    }
    // no attachment, normal E-mail:
    else
    {
      $mail_header = "From: ".$mail_name." <".$mail_email.">\n";
      $mail_header .= "X-Sender-IP: $ip\n";
      $mail_header .= "Content-Type: text/plain";
      if (@mail($mailto,$mail_subject,$text,$mail_header)) $sent = true; else $errors[] = "no connection to the mailserver - please try again later";
    }

    // copy to sender:
    if (isset($sent) && isset($email) && $email != "" && isset($_POST['copy']))
    {
      if (isset($_FILES['probe']['name']) && trim($_FILES['probe']['name']) != "") $copy_mail_text = "Copy of the e-mail:\n\n".$text."\n\nAttachment: ".$_FILES['probe']['name']; else $copy_mail_text = "Copy of the e-mail:\n\n".$text;
      $header= "From: ".$mailto."\n";
      $header .= "X-Sender-IP: ".$ip."\n";
      $header .= "Content-Type: text/plain";
      @mail($email, $mail_subject, $copy_mail_text, $header);
    }
  }
}

if (empty($sent))
{
  if(isset($errors))
  {
    ?><p class="caution">Error:</p><ul><?php foreach($errors as $f) { ?><li><?php echo $f; ?></li><?php } ?></ul><br /><?php
  }

  ?><form name="formnavn" form method="post" action="<?php echo basename($_SERVER["PHP_SELF"]); ?>" enctype="multipart/form-data"><div>
  <p>Navn:<br />
    <input type="text" name="navn" style="border: 1px solid #999999;" value="<?php if (isset($name)) echo htmlentities(stripslashes($name)); else echo ""; ?>" size="35" /></p>
  <p>E-mail:<br /><input type="text" name="email" style="border: 1px solid #999999;" value="<?php if (isset($email)) echo htmlentities(stripslashes($email)); else echo ""; ?>" size="35" /></p>
  <p>Emne:<br /><input type="text" name="subject" style="border: 1px solid #999999;" value="<?php if (isset($subject)) echo htmlentities(stripslashes($subject)); else echo ""; ?>" size="35" /></p>
  Besked:<br />
  <textarea name="text" cols="45" rows="8" style="border: 1px solid #999999;"><?php if (isset($text)) echo htmlentities(stripslashes($text)); else echo ""; ?>
  </textarea>
  <br>
  <br>

  Attachment:<br /><input type="file" name="probe" style="border: 1px solid #999999;cursor:pointer;" value="<?php if (isset($_POST['probe'])) echo htmlentities(stripslashes($_POST['probe'])); else echo ""; ?>" size="20"/></p>
  <br />
  <p><input type="submit" style="border: 1px solid #999999; cursor:pointer;" name="form_submitted" class="submit_knap" value="OK - Send" />&nbsp;&nbsp;&nbsp; <input type="checkbox" name="copy" value="true" /> Send kopi til afsender</p>
  </div>
</form><?php
}
else
{
  if (empty($email)) { ?>
  <p><br /><b>Tak!</b><form name="formnavn"><input type="hidden" name="name"></form><br />
    Beskeden er sendt, men da du ikke angav en e-mailadresse, kan vi ikke besvare din henvendelse.<br />
    </p>
  <?php }
  else { ?><p><b>Tak!</b><form name="formnavn"><input type="hidden" name="name"></form><br />
Beskeden er sendt.<br />
</p>
  <?php }
}

// If you want to remove the Link please donate some Euros:
// http://www.mylittlehomepage.net/donation.html

?><p style="font-size: 9px; color:#999999">Script by <a class="plain" href="http://www.mylittlehomepage.net/">Alex</a></td>
                </tr>
              </table>
                </td>
              <td valign="top" style="border-left:1px dotted #999999;">
                <table width="92%" border="0" align="center" style="height:15px; vertical-align:top;">
                  <tr>
                    <td valign="top" class="sidemenu" style="text-align:left;">
                        <br>
                        <img src="grafik/arrow.jpg" width="14" height="11"><a class="sidemenu" href="om.php">Om Studenterforum</a><br>
                        <br>
                        <img src="grafik/arrow.jpg" width="14" height="11"><a class="sidemenu" href="redaktion.php">Redaktionen</a><br>
                        <br>
                        <img src="grafik/arrow.jpg" width="14" height="11"><a class="sidemenu" href="#">Anbefal til en ven </a></td>
                  </tr>
                </table>
              </td>
            </tr>
          </table>
          <br></td>
        </tr>
    </table></td>
  </tr>
  <tr>
    <td height="15" colspan="3" bgcolor="#FFFFFF" style="vertical-align:top;">&nbsp;</td>
  </tr>
</table>
</body>
</html>
Avatar billede lkekspert Nybegynder
21. juli 2004 - 11:50 #13
Jeg har netop testet dit site - det virkede upåklageligt, fik meddelelsen tilbage:

Tak!
Beskeden er sendt.

..er det ikke sådan det skal virke? Anvender IE 6 sp1.

Lars
Avatar billede dotcom1 Nybegynder
21. juli 2004 - 13:26 #14
Jo, mailformen virker fint, men når mailen er sendt, så vises en lille gul fejlbesked i browserens nederste venstre hjørne. Det er måske ubetydeligt, men det kunne være fint, hvis man kunne rette formen til, så den ikke fremkom. Selve mailformen virker ubeklageligt, som du skriver... :-) Det er kun fordi jeg gerne vil have cursoren til at blinke i navnefeltet...
Avatar billede roenving Novice
21. juli 2004 - 16:16 #15
Hvad er fejl-beskeden ?-)
Avatar billede dotcom1 Nybegynder
21. juli 2004 - 16:26 #16
Fejlen er: "'document.formnavn.navn' er null eller ikke et object" _efter_ afsendelse af en mail fra formen - sikkert fordi formen ikke vises mere efter afsendelsen.
Avatar billede roenving Novice
21. juli 2004 - 16:30 #17
Så skal du jo kun sætte det ind, hvis formen vises !-)

Eller checke om formen er der:

onload="if(document.formnavn)document.formnavn.navn.focus()"
Avatar billede dotcom1 Nybegynder
21. juli 2004 - 16:37 #18
Ja da, det var "bare" det, der skulle til. Smid lige et svar. :-)
Avatar billede dotcom1 Nybegynder
21. juli 2004 - 16:38 #19
Forresten, hvordan kan det være at hvis man klikker cursoren ned i beskedfeltet at den så starter ca. en cm. inde i formen?
Avatar billede roenving Novice
21. juli 2004 - 16:44 #20
Fordi der allerede står nogle mellemrum i det textarea:  #999999;">  </textarea>

-- og velbekomme '-)
Avatar billede dotcom1 Nybegynder
21. juli 2004 - 16:49 #21
Tusind tak! Også for det sidste... :-)
Avatar billede roenving Novice
21. juli 2004 - 16:58 #22
Jeg takker for point ;~}
Avatar billede Ny bruger Nybegynder

Din løsning...

Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.

Loading billede Opret Preview
Kategori
Vi tilbyder markedets bedste kurser inden for webudvikling

Log ind eller opret profil

Hov!

For at kunne deltage på Computerworld Eksperten skal du være logget ind.

Det er heldigvis nemt at oprette en bruger: Det tager to minutter og du kan vælge at bruge enten e-mail, Facebook eller Google som login.

Du kan også logge ind via nedenstående tjenester