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 4 of 4
  1. #1
    New to the CF scene
    Join Date
    Jan 2008
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Guestbook Help!!

    I am trying to create a guestbook where people submit their NAME, EMAIL, and COMMENTS. Upon submit, their comment, name, and the current date are posted in a section underneath the form. When the next person comes to the site, they can see the previous posted message and if they input their own comments, upon submit, their comments with name and date will be posted above the previous comment.

    What I have thus far is the following:

    <!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>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />

    <title>Guestbook</title>

    <script type="text/javascript">
    function submitForm() {
    name = document.theform.username;
    email = document.theform.useremail;
    comm = document.theform.comment;

    html = "<p>";
    html += name + "<br>";
    html += comm + "<br>";
    html += (new Date()) + "<br>";
    html += "</p>";

    alt = document.getElementById("comm").innerHTML;

    document.getElementById("comm").innerHTML = html + alt;

    return;
    }
    </script>

    <FORM id="theform" METHOD="POST" ACTION="Guestbook.htm" onsubmit="return submitForm();">

    <B>Name:</B>
    <INPUT NAME="username" size="30"> <BR>

    <B>E-mail Address:
    </B>
    <INPUT Name="usermail" size="30">
    <h4>Make any comments you'd like below:</h4>
    <LEFT>
    <h5>
    <TEXTAREA NAME="comment" ROWS=6 COLS=60></TEXTAREA>
    </h5>
    <P>
    <INPUT TYPE=submit VALUE="Send it!">
    <INPUT TYPE=reset VALUE="Reset">
    </CENTER>
    </FORM>


    <p>&nbsp;</p>
    <p>&nbsp;</p>

    <div id="comm"></div>

    </body>

    </html>

    I thought this would work but it is not. I am not very fluent in HTML and did most of this by searching the internet. If anyone can help me get this to work, I would really appreciate it

    Thank you

  • #2
    The fat guy next door VIPStephan's Avatar
    Join Date
    Jan 2006
    Location
    Halle (Saale), Germany
    Posts
    8,665
    Thanks
    6
    Thanked 1,006 Times in 979 Posts
    You can’t submit form data without it being processed by a server-side script (such as PHP, ASP, Ruby on Rails, etc.). JavaScript can do some enhancements but where do you store the data that is submitted (i.e. the guestbook entries)?
    You could store the data in a text/XML file but you’d still need more than JS to process it.

  • #3
    New to the CF scene
    Join Date
    Jan 2008
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Could you help me with coding it so that I could get it to work? I registered through GoDaddy and hosting is also through GoDaddy

  • #4
    Senior Coder
    Join Date
    Nov 2003
    Location
    Minneapolis, MN
    Posts
    2,879
    Thanks
    2
    Thanked 65 Times in 56 Posts
    Please don't crosspost. It's against the forum rules.

    http://www.codingforums.com/rules.htm
    Guestbook Help


  •  

    Posting Permissions

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