[Home]
[Edit this page]
[Recent Changes]
[Special Pages]
[Help]
FormsSendJS2
Back to Web Development FAQ Main Page.
There is a way to do so. Sometimes you want to let two cgi scripts analyze the formular input the user has given. The solution is quite easy:
Now the formular is submitted to the "analyze.pl" script first, you can do whatever you want in there, using the formular data. Also the formulars data is submitted to the "thxPage.php" script, in the content frame( so the user can see the output made by this script )
[Edit this page] [Page history] [What links here] [Discuss this topic] [Printer Friendly]
FormsSendJS2
Back to Web Development FAQ Main Page.
There is a way to do so. Sometimes you want to let two cgi scripts analyze the formular input the user has given. The solution is quite easy:
- First of all create a framesite with one frame visible and the other invisible ( width or height is zero for this ones ), name the frames "content" ( for the visible one ) and "analyzer" ( for the invisible one )
- Now put the formular you want to send in the visible frame
- take the usualy used submit button out of your formular and append a simple button with onClick="sendMe();"
- Now append the following code lines to your HTML Script:
<SCRIPT LANGUAGE="JavaScript">
<!--
var URLs = new Array();
URLs[0] = "thxPage.php";
URLs[1] = "../cgi-bin/analyze.pl";
function sendMe() {
document.forms[0].target="analyzer";
document.forms[0].action=URLs[1];
document.forms[0].submit();
document.forms[0].target="content";
document.forms[0].action=URLs[0];
document.forms[0].submit();
}
-->
</SCRIPT>
Now the formular is submitted to the "analyze.pl" script first, you can do whatever you want in there, using the formular data. Also the formulars data is submitted to the "thxPage.php" script, in the content frame( so the user can see the output made by this script )
[Edit this page] [Page history] [What links here] [Discuss this topic] [Printer Friendly]
