[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:

  • 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 )

last edited (December 9, 2002) by KDivad Leahcim, Number of views: 3558, Current Rev: 2 (Diff)

[Edit this page]  [Page history]  [What links here]  [Discuss this topic]  [Printer Friendly]  

Members

Username:

Password:


Register
Forgot Password?




Programmers Heaven - for .NET, Java, C/C++ and WEB Developers!
© 1996-2008 Community Networks Ltd. All rights reserved. Reproduction in whole or in part, in any form or medium without express written permission is prohibited. Violators of this policy may be subject to legal action. Please read Terms Of Use and Privacy Statement for more information. Site Management by Lars Hagelin at Kontantkort.se.