#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2002
    Posts
    10
    Rep Power
    0

    HTML TextArea with ASP


    I am trying to do a check to see if a value of one of my fields is a certain number. If it is I want to display a form text entry box, if not skip it. I want to put a value of another field in the text entry box so the user can edit/update the info. I have the code to display or not display, but when I try to display the value in the text entry field, I get quotes around it. My syntax is below.

    Response.Write("<td> <textarea name=""cStatUnit1"" cols=""70"" rows=""10"">"""&rstblrinews.Fields.Item("cStatUnit1").Value&"""</textarea>")

    If I take a " from each side of the variable, it does not work, like this it displays the date with " around the text. Can someone please help me figure how to get this displayed without quotes?

    Thanks,
  2. #2
  3. No Profile Picture
    Overly white
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2003
    Location
    Fresno, CA
    Posts
    83
    Rep Power
    12

    Thumbs up


    Response.Write("<td> <textarea name=""cStatUnit1"" cols=""70"" rows=""10"">"""&rstblrinews.Fields.Item("cStatUnit1").Value&"""</textarea>")
    The problem is you have to many quotes going on. You have the value inside quotes so therefore it's going to display inside quotes.

    Try this on for size.

    Code:
    Response.Write("<td> <textarea name=""cStatUnit1"" cols=""70"" rows=""10"">" & rstblrinews.Fields.Item("cStatUnit1").Value& "</textarea>")
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2003
    Location
    Shimonoseki / JAPAN
    Posts
    58
    Rep Power
    12
    I prefer writing asp tags inside html code, instead of writing html codes using response.write. My code would be:
    Code:
    <td><textarea name='<%= cStatUnit1 %>' cols='70' rows='10'> <%= rstblrinews.Fields.Item("cStatUnit1").Value %></textarea>
    Oh! BTW, hello everyone. This is my first post to the forums. I am an absolute begginer in MySQL and ASP.

    Regards.
    Sweet smell of a great sorrow lies over the land. Plumes of smoke rise, merge into the leaden sky. A man lies and dreams of green fields and rivers, but awakes to a morning with no reason for waking. He's haunted by the memory of lost paradise. In his youth or dream, he can't be precise. He's chained forever to a world that's departed. It's not enough, it's not enough.
    Gilmour

IMN logo majestic logo threadwatch logo seochat tools logo