Text Block - limit data entered, how?

Author Message

Tian DK

Friday 19 August 2005 2:34:41 am

Hi!

I need to allow users to create a new class, and one of the datatypes will be a text block.

<b>My requirements for the text block is as follows:</b>
<b>1</b> - I need to limit the number of charatcers entered into the text block(for example 250 characters). <i>I know this can be done with text line, but the look of the text line is not very convenient for entering for example a short paragraph of text.</i> Is this possible? Maybe the text line can be changed so it looks like a text block?
<b>2</b> - I need to be able to display a count of how many characters have been typed into the text block(while user is typing). Anybody knows if this is possible? Maybe I will have to use Javascript?

Thanks in advance for any help!

Arran Price

Sunday 21 August 2005 6:46:51 pm

Hi Tian,
If you create a custom template and override the edit for the new class you should be able to control everything.
This would allow you to change the look of the entry fields etc (ie not using the default edit ones).
If you fix the field size to 250 do you still need the count? (I think javascript is likely to be your friend on that one).

Hope thats of some help.

Arran

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.

eZ debug

Timing: Jan 18 2025 20:59:20
Script start
Timing: Jan 18 2025 20:59:20
Module start 'layout'
Timing: Jan 18 2025 20:59:20
Module start 'content'
Timing: Jan 18 2025 20:59:20
Module end 'content'
Timing: Jan 18 2025 20:59:20
Script end

Main resources:

Total runtime0.0234 sec
Peak memory usage2,048.0000 KB
Database Queries3

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0065 587.9375152.6250
Module start 'layout' 0.00650.0030 740.562539.4453
Module start 'content' 0.00950.0113 780.007889.3359
Module end 'content' 0.02080.0025 869.343830.3047
Script end 0.0234  899.6484 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.002410.4148140.0002
Check MTime0.00114.5928140.0001
Mysql Total
Database connection0.00104.262910.0010
Mysqli_queries0.003213.528930.0011
Looping result0.00000.060110.0000
Template Total0.00218.810.0021
Template load0.00124.980810.0012
Template processing0.00093.780210.0009
Override
Cache load0.00062.524510.0006
General
dbfile0.004117.596380.0005
String conversion0.00000.050940.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0001 secs