i want to create a form that once summited sends the details to a spreadsheet, is this possible? if so how would i go about doing it?
Printable View
i want to create a form that once summited sends the details to a spreadsheet, is this possible? if so how would i go about doing it?
Not directly.
You can create a 'comma' separated text file and send it with the form submission. I have used a 'FormMail' cgi program to post the information.
Then read that file into the spreadsheet with the open or import buttons.
Cool, but how do I create the comma separated text file. I am an old (71) neophyte at this part of web site work. I have functioning forms that work and send me the form input. I also understand how to put CST text into a spreadsheet (Excel). But.....
It would be easier to provide an answer if you could provide some example data from which you want to create the file.
Lacking that, you might want to look at some of these sites: http://search.yahoo.com/search?fr=mc...ile+javascript
A very simple example of the input and creation of a CSV file is as follows.
You would need to copy and past the output of the script to a NotePad or WordPad (or similar) application
so you could save the information for the Excel file to read.
Code:<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title> Untitled </title>
<script type="text/javascript">
</script>
<style type="text/css">
#entryForm { list-style-type: none; }
</style>
</head>
<body>
<ul id="entryForm">
<li> <input type="text" value="" name="info"> Firstname </li>
<li> <input type="text" value="" name="info"> Middlename </li>
<li> <input type="text" value="" name="info"> Lastname </li>
<li> <input type="text" value="" name="info"> State </li>
<li> <input type="text" value="" name="info"> Phone </li>
</ul>
<br><input type="button" value="Clear inputs" onclick="clearEntry('entryForm')">
<input type="button" value="Create records" onclick="createRecord('entryForm','CSVinfo')">
<input type="button" value="Clear records" onclick="document.getElementById('CSVinfo').value=''">
<p><textarea id="CSVinfo" rows="10" cols="70"></textarea>
<script type="text/javascript">
function clearEntry(IDS) {
var sel = document.getElementById(IDS).getElementsByTagName('input');
for (var i=0; i<sel.length; i++) { sel[i].value = ''; }
}
function createRecord(entryInfo,outputInfo) {
var tarr = [];
var sel = document.getElementById(entryInfo).getElementsByTagName('input');
for (var i=0; i<sel.length; i++) { tarr.push(sel[i].value); }
document.getElementById(outputInfo).value += '"'+tarr.join('","')+'"\n'; // could also use ";" as separator
}
</script>
</body>
</html>
Here is the code I am using for one of the forms that I am trying to transfer to a spreadsheet.
<body style="background-color: #CCCCCC">
<p><img alt="" height="54" src="images/pic-volunteer.jpg" width="259" />
<span class="auto-style2"><strong>MILITARY VETERANS EMPLOYMENT
EXPO</strong></span></p>
<hr class="auto-style1" style="height: 5px" />
<p class="auto-style2">Please fill out the following form. Items marked with an
asterisk (*) are required.</p>
<form action="/gdform.php" method="post" name="Survey">
<input type="hidden" name="redirect" value="thank_you.html" />
<span class="auto-style2"><strong><span class="auto-style3">
Volunteer Submission Form</span></strong><br />
<br />
*First Name:
<input name="A_FNAME" style="width: 225px" type="text" />
*Last Name:
<input name="B_LNAME" style="width: 225px" type="text" /><br />
<br />
*Phone Number: <input name="C_PHONENO" type="text" /> Email:
<input name="D_EMAIL" style="width: 410px" type="text" /><br />
<br />
I would like to volunteer for the following area(s): (Please
check all that apply.)<br />
<br />
<input name="E_GREETER" type="checkbox" value="Yes" /> Greeter
<input name="F_REGISTRATION" type="checkbox" value="Yes" />
Onsite Registration
<input name="G_PARKING" type="checkbox" value="Yes" /> Parking
<input name="H_SECURITY" type="checkbox" value="Yes" /> Security
<input name="I_RESUME_MENTOR" type="checkbox" value="Yes" /> Resume Mentor
& HR Support<br />
<br />
<input name="J_HUMAN_RESOURCES" type="checkbox" value="Yes" />
Classroom Proctor
<input name="K_DATABASE_INPUT" type="checkbox" value="Yes" />
Database Input
<input name="L_FACILITY_GUIDE" type="checkbox" value="Yes" /> Facility
Guide/Maintenance
<input name="M_HELP_AS_NEEDED" type="checkbox" value="Yes" />
Help as needed<br />
<br />
I am available: (Please check all that apply.)<br />
<br />
<input name="N_DAY1" type="checkbox" value="Yes" /> 1st day
<input name="O_FIRST_SHIFT" type="checkbox" value="Yes" /> 7:00am - 11:00am
<input name="P_SECOND_SHIFT" type="checkbox" value="Yes" /> 10:00am - 2:00pm
<input name="Q_THIRD_SHIFT" type="checkbox" value="Yes" /> 1:00pm - 5:00pm<br />
<input name="R_DAY2" type="checkbox" value="Yes" /> 2nd day
<input name="S_2FIRST_SHIFT" type="checkbox" value="Yes" /> 7:00am - 11:00am
<input name="T_2SECOND_SHIFT" type="checkbox" value="Yes" /> 10:00am - 2:00pm
<input name="U_2THIRD_SHIFT" type="checkbox" value="Yes" /> 1:00pm - 5:00pm<br />
<input name="V_DAY3" type="checkbox" value="Yes" /> 3rd day
<input name="W_2FIRST_SHIFT" type="checkbox" value="Yes" /> 7:00am - 11:00am
<input name="X_2SECOND_SHIFT" type="checkbox" value="Yes" /> 10:00am - 2:00pm
<input name="Y_2THIRD_SHIFT" type="checkbox" value="Yes" /> 1:00pm - 5:00pm<br />
<br />
Special Qualifications:<br />
<textarea name="Z_QUALIFICATIONS" style="width: 833px; height: 100px"></textarea><br />
<br />
Comments:<br />
<textarea name="_1_COMMENTS" style="width: 833px; height: 100px"></textarea><br />
</span><br />
<input name="_3_Submit1" type="submit" value="Submit" />
<input name="Reset1" type="reset" value="Reset" /><br />
<span class="auto-style2">Thank you for volunteering!
</span>
<input name="AA_Volunteer Form" type="hidden" value="Submission" />
</form>
</body>
Did you try to put any of the JS I suggested into your last attempt?
Did you test the example I provided to see if it meets any of your needs?