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
    Jan 2003
    Location
    Italy
    Posts
    57
    Thanks
    0
    Thanked 0 Times in 0 Posts

    multiple entries in a text area form

    Hi

    I’ve been trying to make this work for days, and nothing seems to be working, what I like to do! Is, be able to add text inside the description text area by clicking on the buttons, I’m able to do it for only the first click, but not able to add a second and a 3rd entry without overriding the previous one.
    Example of typical entry in text area: Single, Cartwheel, Windmill.
    Can someone help me?
    Thank you.


    <HTML>
    <HEAD>
    <TITLE>Untitled Document</TITLE> <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
    </HEAD>

    <BODY BGCOLOR="#FFFFFF">
    <FORM NAME="SuzyForm"> <P><FONT FACE="Trebuchet MS"><B>Form:</B></FONT><INPUT TYPE=button VALUE=Single ONCLICK="this.form.PicDesc.value=this.value" NAME=Submit1 STYLE="font:8pt verdana">
    <FONT SIZE="2"><FONT SIZE="2"><FONT SIZE="2"><INPUT TYPE=button VALUE=Cartwheel ONCLICK="this.form.PicDesc.value=this.value" NAME=Submit2 STYLE="font:8pt verdana"></FONT></FONT><FONT SIZE="2"><FONT SIZE="2"><FONT SIZE="2"><FONT SIZE="2"><INPUT TYPE=button VALUE=Windmill ONCLICK="this.form.PicDesc.value=this.value" NAME=Submit3 STYLE="font:8pt verdana"></FONT></FONT></FONT></FONT><INPUT TYPE=button VALUE=Ruffled ONCLICK="this.form.PicDesc.value=this.value" NAME=Submit4 STYLE="font:8pt verdana">
    <INPUT TYPE=button VALUE=Tufted ONCLICK="this.form.PicDesc.value=this.value" NAME=Submit5 STYLE="font:8pt verdana">
    <FONT SIZE="2"><INPUT TYPE=button VALUE=Over-lapped ONCLICK="this.form.PicDesc.value=this.value" NAME=Submit6 STYLE="font:8pt verdana">&nbsp;<INPUT TYPE=button VALUE=Crested ONCLICK="this.form.Form.value=this.value" NAME=Submit7 STYLE="font:8pt verdana"><FONT SIZE="2"><FONT SIZE="2"><FONT SIZE="2"><FONT SIZE="2"><FONT SIZE="2"><FONT SIZE="2"><FONT SIZE="2"><INPUT TYPE=button VALUE=Fringed ONCLICK="this.form.Form.value=this.value" NAME=Submit8 STYLE="font:8pt verdana"></FONT></FONT></FONT></FONT></FONT></FONT></FONT></FONT></FONT></P><P>&nbsp;</P><P><B><FONT FACE="Trebuchet MS">Description:<BR>
    <TEXTAREA NAME=PicDesc COLS=30 ROWS=20 STYLE="font:8pt verdana" WRAP="VIRTUAL"></TEXTAREA>
    </FONT></B></P></FORM><P>&nbsp; </P>
    </BODY>
    </HTML>

  • #2
    New Coder
    Join Date
    Mar 2004
    Posts
    78
    Thanks
    0
    Thanked 0 Times in 0 Posts
    jd2003,

    Here you go. I think your main problems where that your attributes were nor enclosed in double quotes and a couple of your buttons had an incorrect element reference...
    Code:
    ... ONCLICK="this.form.Form.value=this.value" NAME=Submit8 STYLE="font:8pt verdana">
    instead of...
    Code:
    ONCLICK="this.form.PicDesc.value=this.value"
    I took the liberty of cleaning up all those EVIL font tags and simplifying your style elements to a couple page level rules. I also converted the format to XHTML (XHTML must have a valid doctype as well as all element names and attributes in lowercase...and closing tags for all elements.
    Cheers,
    Simon

    Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <title>Untitled Document</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    <style type="text/css">
    #SuzyForm{
    	font: 12px Verdana, Arial, Helvetica, sans-serif;
    	}
    label{
    	display:block;
    	margin: 20px 0 0 0;
    	}
    </style>
    </head>
    
    <body>
    <form name="SuzyForm" id="SuzyForm">
    <label>Form:</label>
          <input type="button" value="Single" onclick="this.form.PicDesc.value=this.value" name="Submit1" />
          <input type="button" value="Cartwheel" onclick="this.form.PicDesc.value=this.value" name="Submit2" />
          <input type="button" value="Windmill" onclick="this.form.PicDesc.value=this.value" name="Submit3" />
          <input type="button" value="Ruffled" onclick="this.form.PicDesc.value=this.value" name="Submit4" />
          <input type="button" value="Tufted" onclick="this.form.PicDesc.value=this.value" name="Submit5" />
          <input type="button" value="Over-lapped" onclick="this.form.PicDesc.value=this.value" name="Submit6" />
      &nbsp;
          <input type="button" value="Crested" onclick="this.form.PicDesc.value=this.value" name="Submit7" />
          <input type="button" value="Fringed" onclick="this.form.PicDesc.value=this.value" name="Submit8" />
    <label for="PicDesc">Description:</label>
            <textarea name="PicDesc" id="PicDesc cols="30" rows="20"  wrap="virtual"></textarea>
    </form>
    </body>
    </html>


  •  

    Posting Permissions

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