Siehe: http://de.selfhtml.org/javascript/beisp ... ngaben.htm
Leider funktioniert die Abfrage nicht.
Keine Fehlermeldung. Alles andere geht problemlos. Kann hier jemand helfen ?
So habe ich das bis jetzt:
Code: Alles auswählen
<script type="text/javascript">
function chkpostform () {
if (document.postform.name.value == "") {
alert("Name ist Pflichteingabe, bitte eingeben!");
document.postform.name.focus();
return false;
}
}
</script>
<form id="postform" method="post" action="{S_POST_ACTION}" onsubmit="return chkpostform()">
<pre>
<!-- IF S_DISPLAY_PREVIEW --><!-- INCLUDE einfuegen_post_prev.html --><!-- ENDIF -->
<fieldset class="submit-buttons">
<input type="submit" tabindex="12" name="preview" value="{L_PREVIEW}" class="button1" onclick="document.getElementById('postform').action += '#preview';" />
</fieldset>
<div class="panel" id="postingbox">
<fieldset class="fields1">
<dl style="clear: left;">
<dt><label for="name">{L_LISTEN_NAME}</label></dt>
<dd><input type="text" id="name" name="name" size="45" tabindex="1" value="{POST_NAME}" class="inputbox autowidth" /></dd>
</dl>
<!-- INCLUDE posting_buttons.html -->
<div id="smiley-box">
<!-- IF .smiley -->
<strong>{L_SMILIES}</strong><br />
<!-- BEGIN smiley -->
<a href="#" onclick="insert_text('{smiley.A_SMILEY_CODE}', true); return false;"><img src="{smiley.SMILEY_IMG}" width="{smiley.SMILEY_WIDTH}" height="{smiley.SMILEY_HEIGHT}" alt="{smiley.SMILEY_CODE}" title="{smiley.SMILEY_DESC}" /></a>
<!-- END smiley -->
<!-- ENDIF -->
{BBCODE_STATUS}<br />
{IMG_STATUS}<br />
{FLASH_STATUS}<br />
{URL_STATUS}<br />
{SMILIES_STATUS}
</div>
<div id="message-box">
<textarea name="message" id="message" rows="15" cols="20" tabindex="0" onselect="storeCaret(this);" onclick="storeCaret(this);" onkeyup="storeCaret(this);" class="inputbox">{MESSAGE}</textarea>
</div>
</fieldset>
<fieldset class="submit-buttons">
{S_HIDDEN_FIELDS}
<input type="submit" tabindex="4" name="preview" value="{L_PREVIEW}" class="button1" onclick="document.getElementById('postform').action += '#preview';" />
<input type="submit" accesskey="s" tabindex="5" name="post" value="{L_SUBMIT}" class="button1" />
</fieldset>
</div>
{S_FORM_TOKEN}
</pre>
</form>