.
Developer Spot - Web Development Tutorials
arrowDeverloper Spot  Tutorials  JAVASCRIPT  Changing Form Action URLs On-The-Fly  
 
Development Tutorials
ASP
CGI & Perl
CSS
HTML
Java
JavaScript
Linux
PHP
XML




More Resources
Web Hosting Articles
Web Development News
PHP Manual
Web Hosting Directory
Budget Web Hosting Linux Web Hosting Small Business Hosting
Windows Web Hosting Reseller Web Hosting Web Hosting Articles

Changing Form Action URLs On-The-Fly

By Will Bontrager
2003-09-03
Reader Rating: 3 out of 5
Bookmark Print Version
Introduction

Sometimes a person just needs to be able to do more with a form.

Today, I'll show you how to change the action="_____" URL on-the-fly, depending on which (if any) radio button is checked by the form user. Drop-down lists could be substituted for radio buttons.

You might not need such functionality for your site at the present time. But when you need it, you'll really need it.

For example, if you use the free Master Feedback from http://willmaster.com/a/20t/pl.pl?msmf to handle your forms, you may want to have the form results sent to a different address under certain conditions. Or, you may want a different "thank you" page. Depending on your particular implementation, you might even want to change the form's method="_____" value.

This article shows you how.

(The Master Form V3 CGI program from http://willmaster.com/a/20t/pl.pl?mfV3 already allows multiple emails, choice of database formats, and choice of "thank you" pages. If you already have Master Form V3 on your site, you probably won't need to add this functionality.)

Using the method described here, you would have more than one copy of Master Feedback installed. The installed scripts can have different file names, or they can be installed in different cgi-bin subdirectories.

Without getting into a description of every nuance, there are nevertheless several things that need to be mentioned for a good understanding of how to implement this feature into your site. Each mention will have examples of code, HTML or JavaScript.

At the end of this article is the entire example.


Article Pages:
Introduction
Mention #1
Mention #2, 3 & 4
Method #5
Mention #6
The Complete Example

Copyright 2004 Bontrager Connection, LLC


 Rate this article:   Poor          Excellent 


If you found this article interesting, you may want to read these as well:



 
Development Tutorials: CGI & Perl - CSS - HTML - Java - JavaScript - Linux - PHP - XML
More Resources: Web Hosting Articles - Web Development News - PHP Manual