Radbryt i textarea
3 svar · 230 visningar · startad av Choronzon
function inpt(tstr) {
document.hForm.mail_body.value += "\n" +tstr+ " ";
document.hForm.mail_body.focus();
}
:)
Peter S skrev:
function inpt(tstr) { document.hForm.mail_body.value += "\n" +tstr+ " "; document.hForm.mail_body.focus(); }:)
Tackar!
Vad är felet med checkform här då?
<html><body>
<script language="Javascript" type="text/Javascript">
<!--
function checkForm(){
if ((document.hForm.subject_field.value.length > 150) || (document.hForm.subject_field.value == "")){
alert ("Please type a subject for your message!")
document.hForm.subject_field.focus();
return false;
}
if (document.hForm.mail_body.value == ""){
alert ("Please type your message!")
document.hForm.mail_body.focus();
return false;
}
}
function inpt(tstr) {
document.hForm.mail_body.value += "\n" +tstr+ " ";
document.hForm.mail_body.focus();
}
// -->
</script><form name="hForm" method="POST" onSubmit="return checkForm()" action="fghfsh">
<br><textarea rows="10" name="mail_body" cols="80"></textarea><br>
<a title="End Bold tag" class="InsertTags" href="javascript:inpt('[/Bold]')">[/Bold]</a>
<input type="submit" class="validate" value="Validate" name="b1">
</form></body></html>