Search Video and Film Sites
Saturday, June 28, 2008
Wednesday, June 11, 2008
![]() By William Bontrager When you want a form that can be submitted without requiring the rather prominent submit button, this article shows you how, with several methods:
This article contains step-by-step
instructions with code examples. I think you'll find it easy to follow. <form name="MyForm" method="POST" action="/cgi-bin/script.cgi">
Second step, the JavaScript — <a href="javascript:document.MyForm.submit();"> Click to submit the form </a>
Optional third step — <noscript> <input type="submit" name="Click here"> </noscript>
The above will display the submit
button only when non-JavaScript browsers visit the page. <form name="MyForm" method="POST" action="/cgi-bin/script.cgi"> <input type="checkbox" name="MyCheck" onClick="DoSubmission();"> Check when done with form Second step, the JavaScript — <script type="text/javascript" language="JavaScript"><!-- function DoSubmission() { document.MyForm.submit(); } //--></script>
Put the JavaScript anywhere on your
page, in the HEAD or BODY area, above or below the form. <form name="MyForm" method="POST" action="/cgi-bin/script.cgi"> <input type="hidden" name="ThisPageURL" value=""> <input type="hidden" name="TimeZoneOffset" value=""> </form>
You'll need to add a hidden field
to let your CGI program know the URL of the "thank you" page it should use. <script type="text/javascript" language="JavaScript"><!-- document.MyForm.ThisPageURL.value = document.URL; var x = new Date(); document.MyForm.TimeZoneOffset.value = x.getTimezoneOffset(); document.MyForm.submit(); //--></script>
When the page is loaded, the JavaScript
will automatically fill in the form with the web page's URL and the time
zone offset information from your visitor's computer, and then automatically
submit the form. After processing the form information, the CGI program presents
a "thank you" page. <iframe height="300" width="200" src="WebPageContainingAutomaticForm.html"> </iframe>
Adjust the URL so the web page containing
the automatically submitted form loads into the IFRAME tag. And adjust the
height and width to accommodate the "thank you" page.
|
Home Biz Tools
![]() By William Bontrager When you want a form that can be submitted without requiring the rather prominent submit button, this article shows you how, with several methods:
This article contains step-by-step
instructions with code examples. I think you'll find it easy to follow. <form name="MyForm" method="POST" action="/cgi-bin/script.cgi">
Second step, the JavaScript — <a href="javascript:document.MyForm.submit();"> Click to submit the form </a>
Optional third step — <noscript> <input type="submit" name="Click here"> </noscript>
The above will display the submit
button only when non-JavaScript browsers visit the page. <form name="MyForm" method="POST" action="/cgi-bin/script.cgi"> <input type="checkbox" name="MyCheck" onClick="DoSubmission();"> Check when done with form Second step, the JavaScript — <script type="text/javascript" language="JavaScript"><!-- function DoSubmission() { document.MyForm.submit(); } //--></script>
Put the JavaScript anywhere on your
page, in the HEAD or BODY area, above or below the form. <form name="MyForm" method="POST" action="/cgi-bin/script.cgi"> <input type="hidden" name="ThisPageURL" value=""> <input type="hidden" name="TimeZoneOffset" value=""> </form>
You'll need to add a hidden field
to let your CGI program know the URL of the "thank you" page it should use. <script type="text/javascript" language="JavaScript"><!-- document.MyForm.ThisPageURL.value = document.URL; var x = new Date(); document.MyForm.TimeZoneOffset.value = x.getTimezoneOffset(); document.MyForm.submit(); //--></script>
When the page is loaded, the JavaScript
will automatically fill in the form with the web page's URL and the time
zone offset information from your visitor's computer, and then automatically
submit the form. After processing the form information, the CGI program presents
a "thank you" page. <iframe height="300" width="200" src="WebPageContainingAutomaticForm.html"> </iframe>
Adjust the URL so the web page containing
the automatically submitted form loads into the IFRAME tag. And adjust the
height and width to accommodate the "thank you" page.
|