Button mit mehreren Funktionen

Volle101

Grünschnabel
Hallo liebe Freunde des html,

ich habe da ein bescheidenes Problem: Auf einer Internetseite habe ich eine Shoutbox eingestellt. Diese könnt ihr hier sehen.

Ich möchte gerne nach dem Drücken des "Abschicken" - Buttons zwei Funktionen ausführen lassen:
1.) Übetragen des Textes in die Shoutbox
2.) Neuladen der Seite

Hier habe ich mal ganz zufällig den html-code beigefügt:
Code:
<!-- header -->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
  <title>{browser_titel}</title>
	<meta name="author" content="Mathias Possinke" />	
	<meta name="language" content="german,deutsch,DE,AT,CH,US" />
	<meta http-equiv="content-language" content="de"/>
	<meta http-equiv="content-type" content="application/xhtml+xml charset=ISO-8859-1"/>
	<link rel="stylesheet" href="{root}design/{design}css/styles.css" type="text/css" />
	<link rel="alternate" type="application/rss+xml" title="Mapos-Scripts.de News RSS" href="http://www.mapos-scripts.de/news.php?rss=true" />
	
</head>
<body onload="window.scrollTo(0,99999);" bgcolor="#3F92D5"> 
<!-- /header -->

<!-- shoutbox_body -->
<table width="100%" cellpadding="0" cellspacing="0" align="center">
								<!--
                <tr>
                    <td class="box_1">Shoutbox</td>
                </tr>
                -->
                <tr>
                    <td class="box_2" colspan="2">
<!-- beitrag_box -->
            <table width="100%" cellpadding="0" cellspacing="0">
                <tr>
                    <td title="{beitrag_datum} {beitrag_zeit}" class="eintrag_{zufall}">
					<p style="margin-top: 0; margin-bottom: 0"><b>
					{beitrag_name}: </b>{beitrag_text}</td>
                </tr>
            </table>
<!-- /beitrag_box -->
</td>
     						</tr>
                <tr>
                    <td class="box_3">
                    <p style="margin-top: 0; margin-bottom: 0">{info_text}
                    <script type="text/javascript">
                    	<!-- 
							function loeschen (box) 
	 	                   {
	 	                   	if (box.defaultValue == box.value)
	 	                   	{
	 	                   		box.value = '';
	 	                   	}
	 	                   }
	 	                   {
						-->
					</script>
                    </p>
                    <form name="eintrag" method="post" action="{phpself}">
                    	<p style="margin-top: 0; margin-bottom: 0">
	                    <input type="text" name="name" size="25" maxlength="25" value="{name}" onclick="loeschen(this)"></input> <br />
	                    <input type="text" name="beitrag" size="25" maxlength="255" value="{text}" onclick="loeschen(this)"></input>
	                    <input type="submit" name="eintragen" value="Abschicken" onclick="loeschen(this)"></input>
	                    </p>
                    </form>
                    </td>
                    <td class="box_3">
                    &nbsp;</td>
                </tr>
<!-- /shoutbox_body -->
<!-- box_1 -->
            </table>
<!-- /box_1 -->
<!-- footer -->
</table>
</body>
</html>
<!-- /footer -->


Schon mim Voraus vielen Dank, für jede Art von Unterstützung.

Viele Grüße
Volker
 
Zuletzt bearbeitet:
Problem gelöst!

Dieses Script eingefügt:

<script type="text/javascript">

var reloadTimeout;

function reloadShoutbox()
{
reloadTimeout = window.setTimeout("document.location.href = document.location.href;", 15000);

}

function resetReload()
{
window.clearTimeout(reloadTimeout);
}

</script>


Den "Body onload"-Befehl geändert nach:

<body onload="window.scrollTo(0,99999);reloadShoutbox();" bgcolor="#3F92D5">

Und das "Form" geändert zu:

<form name="eintrag" method="post" action="{phpself}">
<p style="margin-top: 0; margin-bottom: 0">
<input type="text" name="name" size="25" maxlength="255" value="{name}" onfocus="resetReload();" onblur="reloadShoutbox();" onclick="loeschen(this)" /></input>
<input type="text" name="beitrag" size="25" maxlength="255" value="{text}" onfocus="resetReload();" onblur="reloadShoutbox();" onclick="loeschen(this)" /></input>
<input type="submit" name="eintragen" value="Abschicken" onclick="loeschen(this)"></input>
</p>
</form>

Und hopps, es funktionobelt
 
Zurück