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>
5 svar · 268 visningar · startad av dab
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
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>
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 =/
Ett annat, snarlikt, sätt:
<form name="sbx" action="shoutbox/shoutbox.php?" target="chat" onSubmit="setTimeout('document.sbx.reset()',500);">
tack, tack, tack och tack igen!!!
nu funkar det =))))
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..