webForumDet fria alternativet

Radbryt i textarea

3 svar · 230 visningar · startad av Choronzon

ChoronzonMedlem sedan aug. 20011 346 inlägg
#1
Peter SMedlem sedan dec. 20025 483 inlägg
#2
function inpt(tstr) {
    document.hForm.mail_body.value += "\n" +tstr+ " ";
    document.hForm.mail_body.focus();
}

:)

ChoronzonMedlem sedan aug. 20011 346 inlägg
#3

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>&nbsp;&nbsp;
<input type="submit" class="validate" value="Validate" name="b1">&nbsp;&nbsp;
</form></body></html>
Peter SMedlem sedan dec. 20025 483 inlägg
#4

Förutom att det inte finns något formulärelement som heter subject_field vet jag inte ;)

:)

141 ms totalt · 3 externa anrop · v20260731065814-full.0e50b1ef
0 ms — hämta forumlista (cache)
0 ms — hämta statistik (cache)
138 ms — hämta tråd, inlägg och bilagor (db)