Gossamer Forum
Home : Products : DBMan : Customization :

Maxlength of text fields

Quote Reply
Maxlength of text fields
Mad I am very impressed with this software and with the help of JPDeni's guides getting more ambitious!!

However I have hit one curious problem that some-one may be able to answer.

I have created a data base which includes a text area (own forms being used) - this works ok however I want to expand the text capacity. I cannot get the field to accept more than 200 characters even though I have set "MAXLENGTH" to 1000 in the form. AM I missing anything?

Thanks John I
Quote Reply
Re: [JohnI] Maxlength of text fields In reply to
you have to set the maxlength in the forms html AND the db_def fieldname section of the default.cfg file

Code:
Title => [1, 'alpha', 40, 255, 1, '', ''],


Gene
"The older I get, the more I admire competence, just simple competence in any field from adultery to zoology."
Quote Reply
Re: [esm] Maxlength of text fields In reply to
And, just remember that 255 characters IS the maximum length of a field. Frown
-------------
David Olley
Anglo & Foreign International Limited,
http://www.firehelmets.co.uk

There are 10 types of people in the world: those who understand binary, and those who don't.
Quote Reply
Re: [davidolley] Maxlength of text fields In reply to
I read somewhere that the length of the variable name in perl can be any practical length but may be restricted to 255 characters. I believe that is what you are referring to.

The 255 above refers to the length of the data, not the length of the field name. I have several data fields defined with lengths over 255 - one is 5000. No errors there; they work just fine.

I would like to know at what point perl will squeal on the length of the data.


Gene
"The older I get, the more I admire competence, just simple competence in any field from adultery to zoology."

Last edited by:

esm: Feb 24, 2003, 3:02 AM
Quote Reply
Re: [esm] Maxlength of text fields In reply to
How polite of you to assume that I was not just being ignorant!

I did think that the maximum length of a data field was 255 characters. So I am obviously wrong. Perhaps I assumed this because the demo Dbman never shows field lengths greater than 255 in the cfg file.

I must try this with my db.

Thanks for the correction.
-------------
David Olley
Anglo & Foreign International Limited,
http://www.firehelmets.co.uk

There are 10 types of people in the world: those who understand binary, and those who don't.
Quote Reply
Re: [davidolley] Maxlength of text fields In reply to
well, I am ignorant of perl and freely admit it...Crazy.

yep, there are couple of things in the setup that are somewhat misleading...


Gene
"The older I get, the more I admire competence, just simple competence in any field from adultery to zoology."
Quote Reply
Re: [JohnI] Maxlength of text fields In reply to
 

Here is a related post (note the part about stripping out javascript, etc.)

Also do a search on MAXLENGTH and see if anything more relevant comes up.

Good Luck!
Quote Reply
Re: [Watts] Maxlength of text fields In reply to
Iteresting discussion and thanks for the comments. I'm embarassed to say that the problem with Maxlength of fields was due to "operator error" . I had been adjusting a similar but wrong field and surprise the field I was looking at did not change from the default 200. In order to offer back some information I can also confirm that I have now created text fields of a 1000+ in length with no problems. Thanks once again for the comments. John I
Quote Reply
Re: [esm] Maxlength of text fields In reply to
In Reply To:
I would like to know at what point perl will squeal on the length of the data.
The only limit on string variable lengths in Perl are those of the host machine. Perl will quite happily accept a string variable that uses up every byte of free system memory.

The HTTP and CGI protocols, the server software and the user's browser are likely to have much lower limits on how much data can be sent via a form or form field.

It's usually a lot bigger than 1000 characters though. Many forum posts are extremely long, and the data for those was sent via a form.

I would be wary of sending more than 64Kb total via a form however.
Quote Reply
Re: [wysardry] Maxlength of text fields In reply to
POST accepts a longer string than GET. GET is about 255 characters I think.
Quote Reply
Re: [wysardry] Maxlength of text fields In reply to
thanks for the input...I have one that is 5000. but come to think of it, it sometimes only transmits part of the data.

Never bothered to try and figure out the problem..


Gene
"The older I get, the more I admire competence, just simple competence in any field from adultery to zoology."