View Full Version : Saving user input

06-15-2010, 12:28 PM
Is there any possible way for JS to save changes that a user has made?

my situation is that I'm a photographer who offers photobooks. My customers often have hundreds or thousands of photos and want captions on lots of them. I want to post a photo gallery with a user input form. I've created a simple form, but I want the user to be able to save comments straight to the gallery so I can look at them...

it's only a very simple form and isn't quite finished yet, oh by the way, I'm not sure how to use the check box... but, i'll work on that.

<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Untitled Document</title>
<style type="text/css">
#divWrapper {
text-align: center;
width: 430px;
margin-right: auto;
margin-left: auto;

<script type="text/javascript">
function picForm()
document.frmOutput.outChoice.value="will NOT"
<div id="divWrapper">
<p>Uncheck the box if you do NOT want this photo to appear in your photobook. Please write your caption in the box provided. Any further comments you wish to make can be entered in the second box.</p>
<div id="divInput">
<form name="frmInput">
<table id="tblForm" cellpadding="3px">
<td><input name="addPic" type="checkbox" value="yes">
Add to Photobook</td>
<textarea name="addCap" cols="24" rows="3" value="...Add Caption Here..."></textarea></td>
<textarea name="addComm" cols="24" rows="3" value="...Add Comments Here..."></textarea></td>
<td><div align="right">
<input name="btnSubmit" type="button" value="Submit" onClick="picForm()" />
<div id="divOutput">
<form name="frmOutput">
<p>This photo
<input name="outChoice" type="text" value="" size="7" style="border:0px" />
appear in your photo book.</p>
<p>You would like the caption to read:
<input name="outCap" type="text" value="" size="50" style="border:0px" />
<p>Your comments to us are:
<input name="outComm" type="text" value="" size="50" style="border:0px" />

Please help!

06-15-2010, 01:12 PM
small amounts of text you can save in a cookie, but anything that should be saved along with your site (like comments) must be done server-side.

06-15-2010, 01:13 PM
I've created a simple form, but I want the user to be able to save comments straight to the gallery so I can look at them...
Surely, javascript is a client side language and thus it's not capable to do such actions by itself. You'd need to use some serverside language like PHP/ASP and a database like Mysql/Mssql.

06-16-2010, 06:57 AM
Thank you everybody.
So much to learn, so little time!