[Webinar] Streamline your web hosting managementRegister Today


ACTION attribute

Posted on 1999-11-10
Medium Priority
Last Modified: 2010-04-09
Is it possible to have one of two CGI scripts called when I click on the Submit button on my form based on values entered in one of the text boxes without having to modify either script?
Question by:wariar
LVL 33

Accepted Solution

knightEknight earned 400 total points
ID: 2197756
Yes, do this:

<SCRIPT language='javascript'>
function mysubmit(theform)
   if ( theform.thetextbox.value == "T" )
        theform.action = 'cgi1.cgi';
        theform.action = 'cgi2.cgi';


<FORM name='myform' action='doesnotmatter' method='post' onSubmit='return(mysubmit(this));'>

Author Comment

ID: 2197808
Thanks a lot! That solves a lot of problems!!

Featured Post

Learn to develop an Android App

Want to increase your earning potential in 2018? Pad your resume with app building experience. Learn how with this hands-on course.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Building a website can seem like a daunting task to the uninitiated but it really only requires knowledge of two basic languages: HTML and CSS.
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
In this tutorial viewers will learn how to style transparent/translucent elements using alpha transparency in CSS Start with a normal styled element, such as a div.: Define its "background-color" property as "rgba (255, 255, 255, .5): The numbers in…
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…
Suggested Courses

591 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question