View Full Version : Guestbook Help!!

01-16-2008, 09:43 PM
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">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />


<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;


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

<INPUT NAME="username" size="30"> <BR>

<B>E-mail Address:
<INPUT Name="usermail" size="30">
<h4>Make any comments you'd like below:</h4>
<INPUT TYPE=submit VALUE="Send it!">
<INPUT TYPE=reset VALUE="Reset">


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



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

01-16-2008, 10:54 PM
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.

01-16-2008, 11:02 PM
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

01-16-2008, 11:30 PM
Please don't crosspost. It's against the forum rules.