Please help me with "MAXLENGTH="

A

Anonymous

Guest
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.
 
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..
 
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?
 
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?
 
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.
 
Hey peaples! what wrong with youres? how about HTML part of this forum?
 
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 :(
 
Back
Top