Please help me with "MAXLENGTH="

General discussions related to php

Moderators: macek, egami, gesf

ckwall

Please help me with "MAXLENGTH="

Postby ckwall » Tue Feb 11, 2003 1:55 pm

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.

Hurkle
New php-forum User
New php-forum User
Posts: 36
Joined: Tue Jan 07, 2003 8:45 am
Location: Minnesota, USA

Postby Hurkle » Tue Feb 11, 2003 2:28 pm

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..

ckwall

Postby ckwall » Tue Feb 11, 2003 3:04 pm

hmmm.... let me check that out.
thanks

ckwall

Postby ckwall » Tue Feb 11, 2003 3:06 pm

That was it. I'm a retard! Thanks

Hurkle
New php-forum User
New php-forum User
Posts: 36
Joined: Tue Jan 07, 2003 8:45 am
Location: Minnesota, USA

Postby Hurkle » Tue Feb 11, 2003 3:09 pm

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?

ckwall

Postby ckwall » Tue Feb 11, 2003 3:17 pm

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?

Hurkle
New php-forum User
New php-forum User
Posts: 36
Joined: Tue Jan 07, 2003 8:45 am
Location: Minnesota, USA

Postby Hurkle » Tue Feb 11, 2003 3:21 pm

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.

User avatar
WiZARD
Moderator
Moderator
Posts: 1257
Joined: Thu Jun 20, 2002 10:14 pm
Location: Ukraine, Crimea, Simferopol
Contact:

Re: Please help me with "MAXLENGTH="

Postby WiZARD » Tue Feb 11, 2003 11:20 pm

Hey peaples! what wrong with youres? how about HTML part of this forum?

*JaH*
New php-forum User
New php-forum User
Posts: 80
Joined: Fri Jan 31, 2003 4:18 pm

Postby *JaH* » Fri Feb 14, 2003 4:01 pm

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 :(


Return to “PHP General”

Who is online

Users browsing this forum: Yahoo [Bot] and 2 guests