Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

HTML Forum


You are currently viewing our HTML Forum as a guest. Please register to participate.
Login



Post a Project »

Find a Professional HTML Freelancer!

Find a Freelancer to help you with your HTML projects

FREE Outsourcing eBook!

Reply
What's the best way to put an email form on my site?
Old 09-21-2005, 08:41 AM What's the best way to put an email form on my site?
Super Talker

Posts: 102
Trades: 0
I'd like to put a simple but moderately long information gathering form on my site.

All I need is for the info to be emailed to me. No database or other stuff required.

Users might get part way through the form and decide that they'd like to save it while they get more information.

I'd rather not use the various form submitting sites because I don't want to be dependent upon what someone else does, or doesn't do. I want something on my own site that I can control.

I'd like to use a WYSIWYG form builder for speed of construction. Also because it'll take me about 17 years to do a basic form with my even more basic coding skills.

I've looked at various html and script options but I haven't found anything that meets all my requirements, especially the ability for the user to save the partially completed form on their computer so they can come back to it and save more whenever they want before submitting it.

Any suggestions appreciated.
doggy is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 09-21-2005, 03:28 PM
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,383
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
Ideally you will need a database and server side code to complete this
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 09-21-2005, 06:40 PM
Super Talker

Posts: 102
Trades: 0
Quote:
Originally Posted by chrishirst
Ideally you will need a database and server side code to complete this
Thanks.

I was trying to avoid this as I assume that over time it'll use up a bit of space on my server and I'll have to clean it out periodically.

Is there any way that the user can save the form on his own computer?

I've experimented with saving browser pages on test forms but all I can save is a copy of the page and blank form with the usual IE save options. I can't find a way to save any data in the form. I've Googled but haven't been able to find any software that specifies this feature, although it might be in some but just not mentioned in features.
doggy is offline
Reply With Quote
View Public Profile
 
Old 09-21-2005, 11:24 PM
Skilled Talker

Posts: 62
Trades: 0
Time for some cookies?
__________________

Please login or register to view this content. Registration is FREE
danlefree is offline
Reply With Quote
View Public Profile Visit danlefree's homepage!
 
Old 09-21-2005, 11:34 PM
ericshawn1's Avatar
Novice Talker

Posts: 2
Trades: 0
You can use javascript cookies, particularly the script linked below, to retain the form contents on the user's computer for any time you specify.

And for constructing the form in the first place, what HTML suite are you using? Dreamweaver is the best for this kind of thing, and well worth the cost.

OK, about the CookieForm code: the original is by Nick Baker and you are permitted to use it.

It is here: http://javascript.internet.com/forms...orm-saver.html

BUT... it has a small error. I found that one of its form elements was limited so I fixed its code in javascript. That fixed script is shown here, and you are welcome to use it:



// Begin Fixed Repopulation Code /////////////////////////////////////////////////////

// was: var expDays = 100;
//var expDays = .25; // 6 hours
//var expDays = .0417; // approx. 1 hour
//var expDays = .0208; // approx. 30 minutes
var expDays = .0021; // approx. 3 minutes
//var expDays = .0014; // approx. 2 minutes
//var expDays = .0007; // approx. 1 minute
var exp = new Date();

exp.setTime(exp.getTime() + (expDays*24*60*60*1000));

function getCookieVal (offset) {
var endstr = document.cookie.indexOf(";", offset);
if (endstr == -1) { endstr = document.cookie.length; }
return unescape(document.cookie.substring(offset, endstr));
}

function GetCookie (name) {
var arg = name + "=";
var alen = arg.length;
var clen = document.cookie.length;
var i = 0;
while (i < clen) {
var j = i + alen;
if (document.cookie.substring(i, j) == arg) return getCookieVal (j);
i = document.cookie.indexOf(" ", i) + 1;
if (i == 0) break;
}
return null;
}

function SetCookie (name, value) {
var argv = SetCookie.arguments;
var argc = SetCookie.arguments.length;
var expires = (argc > 2) ? argv[2] : null;
var path = (argc > 3) ? argv[3] : null;
var domain = (argc > 4) ? argv[4] : null;
var secure = (argc > 5) ? argv[5] : false;
document.cookie = name + "=" + escape (value) +
((expires == null) ? "" : ("; expires=" + expires.toGMTString())) +
((path == null) ? "" : ("; path=" + path)) +
((domain == null) ? "" : ("; domain=" + domain)) +
((secure == true) ? "; secure" : "");
}

// cookieForms saves form content of a page.

// use the following code to call it:

// <body onLoad="cookieForms('open', 'form_1', 'form_2', 'form_n')" onUnLoad="cookieForms('save', 'form_1', 'form_2', 'form_n')">

function cookieForms() {
var mode = cookieForms.arguments[0];
for(f=1; f<cookieForms.arguments.length; f++) {
formName = cookieForms.arguments[f];
if(mode == 'open') {
cookieValue = GetCookie('saved_'+formName);
if(cookieValue != null) {
var cookieArray = cookieValue.split('#cf#');
if(cookieArray.length == document[formName].elements.length) {
for(i=0; i<document[formName].elements.length; i++) {
if(cookieArray[i].substring(0,6) == 'select') {
document[formName].elements[i].options.selectedIndex = (cookieArray[i].substr(6));
// Eric Shawn of Sentry (Shawn, Corp. http://www.shawncorp.com) fixed Nick Baker's BUG on 1/20/2005. Was not loading two-digit values into the selectedIndex using his "substring" implementation
// was: document[formName].elements[i].options.selectedIndex = (cookieArray[i].substring(7, (cookieArray[i].length-1)));
// IT COULD NOT REPOPULATE SELECT OBJECTS WITH 10 OR MORE ELEMENTS! Now it does. Someone should tell him.
}
else if((cookieArray[i] == 'cbtrue') || (cookieArray[i] == 'rbtrue')) { document[formName].elements[i].checked = true; }
else if((cookieArray[i] == 'cbfalse') || (cookieArray[i] == 'rbfalse')) { document[formName].elements[i].checked = false; }
else { document[formName].elements[i].value = (cookieArray[i]) ? cookieArray[i] : ''; }
}
}
}
}
if(mode == 'save') {
cookieValue = '';
for(i=0; i<document[formName].elements.length; i++) {
fieldType = document[formName].elements[i].type;
if(fieldType == 'password') { passValue = ''; }
else if(fieldType == 'checkbox') { passValue = 'cb'+document[formName].elements[i].checked; }
else if(fieldType == 'radio') { passValue = 'rb'+document[formName].elements[i].checked; }
else if(fieldType == 'select-one') { passValue = 'select'+document[formName].elements[i].options.selectedIndex; }
else { passValue = document[formName].elements[i].value; }
cookieValue = cookieValue + passValue + '#cf#';
}
cookieValue = cookieValue.substring(0, cookieValue.length-4); // Remove last delimiter
SetCookie('saved_'+formName, cookieValue, exp);
}
}
}
__________________
Sentry Password Protection Membership System for websites. Supports PayPal IPN.

Please login or register to view this content. Registration is FREE
ericshawn1 is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to What's the best way to put an email form on my site?
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.75171 seconds with 12 queries