How do I restrict the amount of text a person can enter in a tx fi

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I often use text boxes in education to have people fill in information.
Sometimes, they must print the info they type in. I want to create a box that
equals the size maximum amoun to text without allowing people to scroll down
for more space. Any ideas?
Thanks, Leecy
 
See reply to your most recent post.

--
==============================================
Thomas A. Rowe (Microsoft MVP - FrontPage)
WebMaster Resources(tm)

FrontPage Resources, WebCircle, MS KB Quick Links, etc.
==============================================
If you feel your current issue is a results of installing
a Service Pack or security update, please contact
Microsoft Product Support Services:
http://support.microsoft.com
If the problem can be shown to have been caused by a
security update, then there is usually no charge for the call.
==============================================
 
Thanks, Thomas. I've done that. However, even if I limit the size of the box,
the user can still keep writing, and a scroll bar appears. Maybe my question
should how to eliminate the scroll bar. What I would like to see online is a
box that people can write in without the option of going outside of the size
of the box. Make sense?

Thanks!
Leecy
 
You still should be able to limit the amount text enter using the Form Field Validation.

--
==============================================
Thomas A. Rowe (Microsoft MVP - FrontPage)
WebMaster Resources(tm)

FrontPage Resources, WebCircle, MS KB Quick Links, etc.
==============================================
If you feel your current issue is a results of installing
a Service Pack or security update, please contact
Microsoft Product Support Services:
http://support.microsoft.com
If the problem can be shown to have been caused by a
security update, then there is usually no charge for the call.
==============================================
 
It doesn't work. The scroll bar just keeps moving as the user enters as much
information as he/she wants. I want the text to stop. I can validate the text
box that way, but not the text area where the scroll bar appears.

Thanks for trying to help.
 
Leecy,

Are trying to stop the user from entering more character then what you want, during actual data
entry or when the form is submitted?

The FP Form Field validation does not validate the field content until the user has actual clicked
the submitted button, see example:

http://www.ycoln-resources.com/Help/Leecy.htm

I think you would need to search for a JavaScript Character counter script or learn to write
JavaScript. However then you will not be able to use FP's Form Field Validation.



--
==============================================
Thomas A. Rowe (Microsoft MVP - FrontPage)
WebMaster Resources(tm)

FrontPage Resources, WebCircle, MS KB Quick Links, etc.
==============================================
If you feel your current issue is a results of installing
a Service Pack or security update, please contact
Microsoft Product Support Services:
http://support.microsoft.com
If the problem can be shown to have been caused by a
security update, then there is usually no charge for the call.
==============================================
 
That's the trick. I want to stop the user during the writing. The reason?
Different teachers will be teaching the content, so I want the user to enter
the info and print it for the instructor. If there is more text than shows on
the screen, it will only print part of the response. The student never
submits the form. I just want a limited writing box online that doesn't
require submission.
 
I do not know of a way to do this, except by using ASP/VBScript (server-side script), then you could
have the students enter the text in the form, then submit it to another page that just display the
entered text, which can then be printed.

I have modified my original example to show you how this would work.
http://www.ycoln-resources.com/Help/Leecy.htm

--
==============================================
Thomas A. Rowe (Microsoft MVP - FrontPage)
WebMaster Resources(tm)

FrontPage Resources, WebCircle, MS KB Quick Links, etc.
==============================================
If you feel your current issue is a results of installing
a Service Pack or security update, please contact
Microsoft Product Support Services:
http://support.microsoft.com
If the problem can be shown to have been caused by a
security update, then there is usually no charge for the call.
==============================================
 
Yes. I can see where that would work. I used the sample on your site. I would
have to find a way to identify the response for the teacher, but maybe I can
figure something out.

Right now, my solution is to limit the characters in one-line text boxes and
paste them one after another, like lines on a page. I format the lines so
that they look like spaces rather than text boxes. The students have to use
the Tab key or click in the next box to complete the assignments, but ...

I really appreciate the help. I'll look into Java. I guess it's time... :-)
 
JavaScript...not Java.


Leecy said:
Yes. I can see where that would work. I used the sample on your site. I would
have to find a way to identify the response for the teacher, but maybe I can
figure something out.

Right now, my solution is to limit the characters in one-line text boxes and
paste them one after another, like lines on a page. I format the lines so
that they look like spaces rather than text boxes. The students have to use
the Tab key or click in the next box to complete the assignments, but ....

I really appreciate the help. I'll look into Java. I guess it's time... :-)
 
Hi,
This is easy enough with javascript - and it'll play nice with the FP
validation
<textarea onkeypress="return this.value.length<10;" rows="5" cols="5"
name="whatever">

This won't let the user type more than 10 characters including new lines
spaces etc, obviously change 10 to whatever number you want.
 
I remembered seeing this a while ago, and found an easier way to do it

<input type="text" name="fred" value="anyvalue" size="3" maxlength="10" >
You need to increase size to allow for more characters, but with this spec,
you can't enter more than 10 characters

--
Cheers,
Trevor L.
Website: http://tandcl.homemail.com.au

Jon said:
Hi,
This is easy enough with javascript - and it'll play nice with the FP
validation
<textarea onkeypress="return this.value.length<10;" rows="5" cols="5"
name="whatever">

This won't let the user type more than 10 characters including new
lines spaces etc, obviously change 10 to whatever number you want.


I choose Polesoft Lockspam to fight spam, and you?
http://www.polesoft.com/refer.html
 
If the guy had asked how to restrict input in <input type="text" obviously
I'd have given him this answer. He asked how to restrict input in a
extarea - maxlength does not work in textarea, which is why I gave the
javascript solution.
 
Jon,
Sorry about that. :(((
It just seemed so neat.

I do not intend to offend you Microsoft MVPs
 
Back
Top