Page 1 of 1

Please help me with "MAXLENGTH="

Posted: Tue Feb 11, 2003 1:55 pm
by ckwall
This is the script that works. All I want to do is make it so that it has a maxlength argument.

?>
<FORM NAME="fa" ACTION="web/attorney_message.php" METHOD="POST">
<B>Attorney's Message:</B><br>
<TEXTAREA NAME="attorney_message" ROWS=5 COLS=40></TEXTAREA>
<INPUT TYPE="submit" VALUE="Update" MAXLENGTH="10">
</form>

So this is what I tried:

?>
<FORM NAME="fa" ACTION="web/attorney_message.php" METHOD="POST">
<B>Attorney's Message:</B><br>
<INPUT TYPE=TEXT NAME="attorny_message" MAXLENGTH=4><BR>
<P><INPUT TYPE="submit" VALUE="submit">
</form>

I dont know PHP well so if you could see if you could straighten me out, I would appreciate it.

Posted: Tue Feb 11, 2003 2:28 pm
by Hurkle
well, textareas don't have the maxlength property, whereas text type inputs do. Your code looks good to me, altho you might have a mispelling that will give you problems. make sure that attorney is spelled the same throughout your code, it's not in what you posted.

hope that helps..

Posted: Tue Feb 11, 2003 3:04 pm
by ckwall
hmmm.... let me check that out.
thanks

Posted: Tue Feb 11, 2003 3:06 pm
by ckwall
That was it. I'm a retard! Thanks

Posted: Tue Feb 11, 2003 3:09 pm
by Hurkle
no prob. spelling gets me every time. As we speak, I'm working on a huge law office database, and I finally learned to use 'lawyer' instead of 'attorney', as I always spell it wrong. What type of thing are you working on?

Posted: Tue Feb 11, 2003 3:17 pm
by ckwall
It is a place in a website that our directing attorney of our lawfirm can post dynamic messages.

Here is another question somewhat related, with that code:
?>
<FORM NAME="fa" ACTION="web/attorney_message.php" METHOD="POST">
<B>Attorney's Message:</B><br>
<INPUT TYPE=TEXT NAME="attorney_message" MAXLENGTH=4><BR>
<P><INPUT TYPE="submit" VALUE="submit">
</form>

is it possible to make it so that after a certain number of characters are typed it adds a return?

Posted: Tue Feb 11, 2003 3:21 pm
by Hurkle
I don't know of any way to do that, without using client side script, such as vbscript or javascript. I no longer use client side script at all, ever, as it was created by the devil to plague me..

My reccomendation would be to ditch the text type input, go back to a text area, and set the data type of the field that stores the message to 'text'. That lets it be so freaking huge, you don't have to worry about max size.

In my opinion, one should avoid client side scripting whenever possible. It's too dependent on browser version and user settings.

Hope this helps.

Re: Please help me with "MAXLENGTH="

Posted: Tue Feb 11, 2003 11:20 pm
by WiZARD
Hey peaples! what wrong with youres? how about HTML part of this forum?

Posted: Fri Feb 14, 2003 4:01 pm
by *JaH*
client-side scripting sux indeed :( I'm trying to write something that can be used on many types of browsers, but that's almost impossible these days...Takes loads of time :(