Help with forms

  • Thread starter Thread starter Anonymous
  • Start date Start date
A

Anonymous

Guest
I have two forms. One is for a summary on one page and needs to have a MAXLENGTH of 75. I have the form working, but, I need it to wrap text, or allow returns in the text to start a new line. basically I need it to work like my second script, but with the MAXLENGTH like my first. Any suggestions?

<FORM NAME="summary" ACTION="web/spences_summary.php" METHOD="POST">
<B>Spences Corner Summary:
(75 characters max)</B><br>
<INPUT TYPE=TEXT NAME="spences_summary" MAXLENGTH=75><BR>
<P><INPUT TYPE="submit" VALUE="submit">
</form>

<FORM NAME="message" ACTION="web/spences_message.php" METHOD="POST">
<B>Spences Corner Message:</B><br>
<TEXTAREA NAME="spences_message" ROWS=5 COLS=40></TEXTAREA>
<INPUT TYPE="submit" VALUE="Update">
</form>
 
I think the only way you'd get maxlength working on a textarea is to javascript the submit event with a field check

<input type="submit" onclick="(document.forms['message'].elements['spences_message'].length<75)?document.forms['message'].submit:alert('drat too long'); return false" value="click me" />

flytyped == untested
 
Man, I really hope that someday plain vanilla HTML will give us either a textArea with a maxlength property, or a text input with a multiline option. Having 2 choices for basic text entry, and nothing that has the best of both, is a pain in the tookus.
 
Back
Top