Solved

TextField rows

Posted on 2004-09-21
5
182 Views
Last Modified: 2010-04-25
Is there a way to restrict the user from entering more than a certain number of rows in a TextField? I would like the user to be able to enter only 4 lines of data and that too with a specified number of columns.

I have set the properties in Dreamweaver, Num Lines to 4, but that does not seem to restrict the user.

Any idea what i am doing wrong or can do differently to do this right???

KM
0
Comment
Question by:KalluMama
  • 2
  • 2
5 Comments
 
LVL 14

Accepted Solution

by:
Esopo earned 400 total points
ID: 12114388
Hi KM,

>>Num Lines to 4, but that does not seem to restrict the user<<
You are right, it doesn't. It only tells the page how big you want the textarea to be.

A textarea can't be restricted through HTML code, you would need some scripting to do that.
While in the proccess of getting you such script I realized there is a much simpler solution for you:


>> I would like the user to be able to enter only 4 lines of data and that too with a specified number of columns<<

If you are this sure about the exact amount of information you spect from your users, then you should go with one line textfields:

*************************
<input name="textfield" type="text" size="50" maxlength="50">
  <br>
  <input name="textfield2" type="text" size="50" maxlength="50">
  <br>
  <input name="textfield3" type="text" size="50" maxlength="50">
  <br>
  <input name="textfield4" type="text" size="50" maxlength="50">
*************************

These are four lines of text input limited to 50 chars each. Easy and no scripting required (at least for this part).

Best regards,

Esopo.
0
 

Author Comment

by:KalluMama
ID: 12123241
i needed all the info in one box....
0
 
LVL 2

Expert Comment

by:whitefael
ID: 12123323
Just so I can understand the problem a little better, what kind of data are the users entering that it must be entered in one text box? Unless you have some out of the ordinary situation, Esopo's suggestion is probably the best way to do it using HTML only.

Brian
0
 

Author Comment

by:KalluMama
ID: 12123392
The data being entered is just plain text...stored as Memo in access.
0
 
LVL 2

Assisted Solution

by:whitefael
whitefael earned 100 total points
ID: 12127396
If the data is being written to the Access database, I would just follow what Esopo wrote. Next, the Submit button should link to a page that processes the data, like process.asp (I'm assuming you're using ASP pages since you are working with the Access database). The VBScript in this page would take the four strings and combine them into one string. Then you just connect to your database and write the single string into the Memo field.  If successful, process.asp will display some kind of "Your data was successfully entered." or whatever you want to say.

It's been many, many years since I've even looked at ASP, so maybe someone else can provide you with the code. If you're working with the database, you may already know how to do this.

Hope this helps!
Brian
0

Featured Post

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Suggested Solutions

For those who don't know, Adobe Dreamweaver is a popular commercial web editor that enables you to design, build and manage complex websites. The editor is a WYSIWYG (What You See Is What You Get) web editor, which means that you can create your web…
This article is very specific and is only intended to help if you are installing Dreamweaver 8 in a Windows 7 environment with Office 2007 installed.   I'm not sure why Microsoft tends to release OS' that should not be released but they do.  Windows…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now