?
Solved

TextField rows

Posted on 2004-09-21
5
Medium Priority
?
189 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 1600 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 400 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

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

I still run into .cgi files every now and then. In some instances, I actually prefer the simplicity of a .cgi script to other options. Since I use DreamWeaver extensively, what I needed was a way to open .cgi scripts in Dreamweaver. And I wanted to …
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…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
Suggested Courses

771 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