Gossamer Forum
Home : Products : Gossamer Links : Version 1.x :

pre-mod: multi-part submit form

Quote Reply
pre-mod: multi-part submit form
Hi,

I've been playing around with a multi-part submission for as a method of helping to avoid being spammed and to make people stop and look a little harder before they continue with their site suggestion. I've got it working but have a few problems (probably of my own making Smile) and wondered if anyone could offer some insight as to how to overcome them.

Here's what I've done so far:

Created three templates; add_step_1.html > add_step_2.html > add_step_3.html

In each template I have changed the 'Submit' value; Step 1 - 'step2', Step 2 - 'step3' and Step 3 - 'add' (this is so that the add script knows which template to display next.)

I've copied add.cgi to addmulti.cgi and added some new code so that it looks in the form for the value of the 'submit' variable and goes forward to the next part if its not 'add' (the last thing to do!):

else {
$category = &get_category_list ();
}

if ($in->param('step2')) {
my $id = $in->param('ID');
my $sitetitle = $in->param('Title');
my $siteurl = $in->param('URL');
&site_html_add_form_2 ({ catid => $id, Title => $sitetitle, URL => $siteurl, Category => $category, banner_html => $banner_html, button_html => $button_html, text_html => $text_html, %in }, $dynamic);
}
elsif ($in->param('step3')) {
my $id = $in->param('ID');
my $sitetitle = $in->param('Title');
my $siteurl = $in->param('URL');
my $sitedescription = $in->param('Description');
&site_html_add_form_3 ({ catid => $id, Title => $sitetitle, URL => $siteurl, Description => $sitedescription, Category => $category, banner_html => $banner_html, button_html => $button_html, text_html => $text_html, %in }, $dynamic);
}
else {
&site_html_add_form_1 ({ catid => $id, Category => $category, banner_html => $banner_html, button_html => $button_html, text_html => $text_html, %in }, $dynamic);
}


You may notice that in each step the previous variables are passed to the template so that they can be 'forwarded' with each step of the submission (I found that if I didn't do that it would forget them and give an error at the point of adding the suggestion to the database. I've also got some extra tags for my banners and buttons, etc. - ignore those.)

In addition, the 'template' calls have been changed in HTML_Templates.pm so each one calls a different template.html file; 1, 2 & 3.

You can see it working (its not 'live' yet so please put 'Testing' or something obvious like that in the fields if you wish to try it out) at: http://www.qango.com/cgi-local/or/addmulti.cgi?ID=54

It works fine if you do a 'good' suggestion and stick to the guidelines and required fields, etc., and adds the suggestion to the validation database just as it does on the single part form, but I have got a few issues that I'm sure people will come across if they use it as it is.

1) Going-back to a previous part of the form (not really sure how to do it?)
2) Error checking the form fields at each 'step' rather than at the end?
3) Re-loading without the 'Re-post Form Data' request appearing?
4) Server complaining it can't find the form data after it's been left on-screen for a short time and failing to do anything other than sit at whatever step you are up to?

I may have gone about it completely the wrong way, if I have I wouldn't mind some pointers as to how I should re-work it, or start again Smile


All the best
Shaun

Subject Author Views Date
Thread pre-mod: multi-part submit form qango 3246 Nov 6, 2000, 12:09 PM
Thread Re: pre-mod: multi-part submit form
Stealth 3169 Nov 6, 2000, 12:24 PM
Thread Re: pre-mod: multi-part submit form
qango 3154 Nov 6, 2000, 3:21 PM
Thread Re: pre-mod: multi-part submit form
Stealth 3157 Nov 6, 2000, 6:40 PM
Post Re: pre-mod: multi-part submit form
qango 3157 Nov 7, 2000, 2:23 AM