|
Submit form conditionally - JavaScript
|
By SiteArticles.com
[Hits: 12828]
|
|
In the long-gone days of the early Internet, having a form onthe website was tantamount to dabbling with "cutting-edge"technologies. Intricate Perl scripts and esoteric CGI scriptswere required to process those forms and people used to sufferbouts of cold sweat whenever there manifested a need to use webforms. To create a form-handling script used to be in the realmsof MCAs and computer engineers. No longer is it so. The Internetthese days is replete with all sorts of form handling scripts,and wherever you choose to host your website, or for that mattereven a web page, you can easily deploy a form handling scriptand start interacting with your visitors.
As the level of interaction goes complex, you require morecomplicated scripts. One way is to write a single scriptcontaining hundreds of lines of code. The action script (thatcomes within
As you can see, this form displays three radio buttons. Theobjective is, send the form to a script according to the radiobutton selected. Since some Javascript action needs to takeplace once the Submit button is clicked, we invokedecide_action() function through the onSubmit attribute of the |
|
|
|