Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

TextField rows

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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

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…
Adobe Dreamweaver CS5 is a WYSIWYG web page editor that has advanced HTML, CSS, and Javascript rendering functionality and is probably the most well-known HTML editor available. Much of Dreamweaver's appeal centers around the Design View interfac…
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…
Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …
Suggested Courses

877 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