If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 2 of 2
  1. #1
    Junior Member
    Join Date
    Dec 2011
    Member #
    I am trying to use the suggestion of using Javascript for showing text in a text area of a very simple form.
    The site (and page) I found to help me accomplish this is:
    "How to set the value of a form element using Javascript"
    It was a little tricky --I first had to learn that a simple "text input" tag wouldn't do and I needed the "text area" tag. And it seemed this article would do the trick. But here's where I'm at:

    This link shows the little text area I'm trying to fill w/ text:
    at the bottom left I want a window where people can submit ideas for a blog. But I want the text box to show the text: "Please submit ideas for our blog here-we'd love to hear from you!" until people click in it.

    The next link shows a text area using the code the site supplied and its working! --shows the text: "Please enter your complaint in brief"
    The code putting the text in the box is in the body tag
    <body onLoad="initForm(document.forms[0], 'service_complaint', 'Please enter your complaint in brief');">
    and I've done it the same way on the other file:
    <body onload="initForm(document.forms[0], 'blog_suggestion', 'Please submit ideas for our blog here-we'd love to hear from you!');">
    BUT, it doesn't display it. The file is also using a javascript file called "demo1.js" which I've linked to both files.

    What I'm wondering is whether or not there's something in the code of the page that is causing it to fail. There is the use of PHP a lot. I've also called the little test file that's working "index1a.php" to see if it would still work and it did, but there's actually no PHP code in the file.
    Any help w/ this would be appreciated.


  3. #2
    WDF Staff AlphaMare's Avatar
    Join Date
    Oct 2009
    Montreal, Canada
    Member #
    878 times
    On the page where it's not working, your code is a mess - check how many <head> and <body> tags you have. And around line 96 your close your </html> tag - yikes! I think you've been working at this and cutting and pasting, and not always cutting everything you should have.

    I've re-written your code from the top down to the start of your <container> div and zipped it up for you - see if it works now.
    Good design should never say "Look at me!"
    It should say "Look at this." ~ David Craib ~ my current site . . ~ my email

    If you feel that someone's post helped you fix your problem, answered your question, or just made you feel better, feel free to "Like" their post. The "Like" link is at the bottom right of each post, along side the "reply" link. And if you are being helped here, try to help someone else - pass it on!

Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
All times are GMT -6. The time now is 08:17 PM.
Powered by vBulletin® Version 4.2.3
Copyright © 2020 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: