Popup Confirms Form Submit

[Total: 0    Average: 0/5]

This example shows how to have a form reconstructed in a popup window.

Body Code:

<form name=f1 onsubmit="return validateIt(document.f1);">
<input type=text name="faction" value="http://www.js-x.com/">
<input type=text name="fmethod" value="get">
<input name=t1 value="one">
<input name=t2 value="two">
<input type=submit value="Go">

var _st="";

var _win=null;
function validateIt(_f)
_st+="<html><head><title>Verify Form</title></head>";
_st+="<form action='";
_st+="' method='";
_st+="<input name=t1 value='"+_f.t1.value+"'>";
_st+="<input name=t2 value='"+_f.t2.value+"'>";
_st+="<input type=button value='Cancel' onclick='self.close()'>";
_st+="<input type=submit value='Submit'>";

	  /* wait 1 second then write output */

   * do not submit this form.
  return false;

Times Viewed: 1

Leave a Reply

Your email address will not be published. Required fields are marked *