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 2 of 2
  1. #1
    New Coder
    Join Date
    Jun 2003
    Location
    Sunshine Coast, Australia
    Posts
    28
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Adding specific multiline text to a Text Area

    I require a function that adds multiple lines of text to what already exists in the text area. This is what i came up with but am unsure why it dont work
    Its to create functions similar to those link and Bold buttons in the forum here but to add HTML in this case its adding a table with 2 columns.

    <script language = Javascript 1.2>
    Function addtableone();
    {
    document.form2.para1.value = document.form2.para1.value + vbcrlf + "<table width='100%' bgcolor=''>" + vbcrlf + "<tr>" + vbcrlf + "<td width='50%'>INSERT COLUMN 1 CONTENT HERE</td>" + vbcrlf + "</tr>" + vbcrlf + "<tr>" + vbcrlf + "<td width='50%'>INSERT COLUMN 2 CONTENT HERE</td>" + vbcrlf + "</tr>" + vbcrlf + "</table>"
    }
    </script>

    and to execute the Function:
    <input type="button" name="fnTableOne" value="ADD TABLE" onClick="addtableone();">

    Surely this is a rather easy thing to fix, hopefully
    =======================
    'There are 10 types of people in the world, those who understand binary and those who do not."

  • #2
    Regular Coder
    Join Date
    Nov 2002
    Posts
    596
    Thanks
    0
    Thanked 0 Times in 0 Posts
    1) function (lowercase)
    2) document.form2.para1.value += (shorthand)
    3) Use single quotes for your JS string, doubles for HTML. Not absolutely required, but nicer.


  •  

    Posting Permissions

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