Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4

Thread: line check ?

  1. #1
    New Coder
    Join Date
    Oct 2005
    Posts
    24
    Thanks
    0
    Thanked 0 Times in 0 Posts

    line check ?

    To replace a standard textarea, I make use of a so called WYSIWYG. I use the coding at: http://www.dynamicdrive.com/dynamici...itor/index.htm for this. Though now I want to include something extra's namely a check on how many lines are inputted by the user.

    I don't want the user to submit more then lets say 40 lines. If he/she inputs more then 40 lines the form may not be submitted, and an alert box should appear. I also want this to happen if he/she submits no lines.

  • #2
    New Coder
    Join Date
    Oct 2005
    Posts
    24
    Thanks
    0
    Thanked 0 Times in 0 Posts
    never mind, i will look for an other solution..

  • #3
    Regular Coder
    Join Date
    Sep 2005
    Location
    Chicago, IL
    Posts
    160
    Thanks
    0
    Thanked 0 Times in 0 Posts
    You can't really count the lines because every text box is a different size and shape, but you could do it by counting characters or words and setting a max. number of words or characters to allow, and you could always figure out the lines by creating the text box the size that you want and then counting how many characters are in one line and multiplying that by the number of lines you want to allow. sound decent?
    I'm only telling you how I would do it, not how its supposed to be done. ;)

  • #4
    Regular Coder
    Join Date
    Sep 2005
    Location
    Chicago, IL
    Posts
    160
    Thanks
    0
    Thanked 0 Times in 0 Posts
    for a textbox the 'cols' value is how many characters you can type in one row, so if you have a textbox that has 'cols="30"' and you only want to allow 40 lines then you can only allow 1200 characters. (num. of cols x 40 lines).
    I'm only telling you how I would do it, not how its supposed to be done. ;)


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •