dabMedlem sedan apr. 2001109 inlägg jag kan nada om javascript men jag skulle vilja rensa ett textfält typ något i stil med:
<script>
<!--
function cleartext() {
document.forms(0).shout.value = "";
}
//-->
</script>
<form name="sbx" action="shoutbox/shoutbox.php?" target="chat">
<input type="text" name="shout" size="22">
<input type="submit" name="Submit" value=":: skicka" onSubmit="cleartext()">
</form>
men jag får inte det att funkar..
Jag laddar inte om sidan som innehåller denna koden, utan skickar informationen till en iframe (target="chat").
/mvh dab
JojoxxMedlem sedan juni 20004 308 inlägg En enklare variant är;
<form name="sbx" action="shoutbox/shoutbox.php?" target="chat" onSubmit="fo=this; setTimeout('fo.reset()',500);">
<input type="text" name="shout" size="22">
<input type="submit" name="Submit" value=":: skicka">
</form>
dabMedlem sedan apr. 2001109 inlägg Detta funkade inte:
<form name="sbx" action="shoutbox/shoutbox.php?" target="chat" onSubmit="fo=this; setTimeout('fo.reset()',500);">
Får fo is undefiened, testade med sbx också det funkade inte heller =/
dectgapMedlem sedan sep. 20021 655 inlägg Ett annat, snarlikt, sätt:
<form name="sbx" action="shoutbox/shoutbox.php?" target="chat" onSubmit="setTimeout('document.sbx.reset()',500);">
dabMedlem sedan apr. 2001109 inlägg tack, tack, tack och tack igen!!!
nu funkar det =))))
colioneMedlem sedan juni 20014 421 inlägg
Jojoxx skrev:
En enklare variant är;
<form name="sbx" action="shoutbox/shoutbox.php?" target="chat" onSubmit="fo=this; setTimeout('fo.reset()',500);">
<input type="text" name="shout" size="22">
<input type="submit" name="Submit" value=":: skicka">
</form>
chockad, Jojoxx hade fel på en kodsnutt....
Nej bara skoja det funkade för mej..