Solved

TextField rows

Posted on 2004-09-21
5
188 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.

724 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