SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Enthusiast
    Join Date
    Dec 2005
    Posts
    38
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Keeping users from messing up entry

    I have this cool textbox which you can test here: http://www.freewebs.com/moreauctions/addtext.html

    As you can see it adds a linebreak after each text is added. It is meant to creat a list to be output from a form. But a user can click inside the textarea end mess up the list and enter anyway they want.

    How can I make sure that there is always a linebreak between each line of text?

    Code:
    <input size="20" id="inputtext">
    <input name="add" value="Add" onclick="document.getElementById('textarea').value+='•'+inputtext.value+'\n\n';" type="button">
    <textarea rows="15" id="textarea" name="box" cols="22"></textarea>
    I have considered the readonly option but I need users to be able to delete entries.
    Last edited by Site Owner; Jul 27, 2007 at 20:04.

  2. #2
    SitePoint Guru
    Join Date
    Apr 2006
    Posts
    802
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I'd use a group of text input boxes, one for each new list item.


Bookmarks

Posting Permissions

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