<html>
<head>
<title>Multiple Form Multiple Submit Buttons - RJM Programming - February, 2015</title>

<link href='//www.rjmprogramming.com.au/PHP/emboss_h1.css' rel='stylesheet' type='text/css'>
<script type='text/javascript'>

var ans='';
var oif=null;
var odiv=null;

function cif() {
oif=document.getElementById('mycif'); //'myif');
if (oif != null) {
oif.style.display='block';
odiv=document.getElementById('mydiv');
odiv.style.display='none';
}
}

function checkurl() {
oif=document.getElementById('mycif'); //'myif');
if (oif != null) {
var oform;
for (var i=1; i<=4; i++) {
eval("oform=document.getElementById('myform" + i + "')");
oform.target='mycif'; //'myif';
}
}
if (document.URL.indexOf('ask=') != -1) {
ans = prompt("What is the answer to my question?", "");
document.body.innerHTML = "<h1 align='center'>Your answer to the question is ... " + ans + "</h1><br><br>" + document.body.innerHTML;
} else if (document.URL.indexOf('email=') != -1) {
document.body.innerHTML += '<a style="display:none;" id="aemail" href="mail' + 'to:?subject=My%20Email%20Question%20to%20you" title="Email">Email</a>';
document.getElementById('aemail').click();
} else if (document.URL.indexOf('iframe=') != -1) {
var mydate = new Date();
document.body.innerHTML = "<h1 align='center'>We'll proceed in an iframe below ... " + mydate + "</h1><br><br><iframe name='myif' id='myif' src='./multiple_form_multiple_submit_buttons.html' style='width:100%;height:1200px;display:none;'></iframe><div id='mydiv' align='center' style='display:block;'>" + document.body.innerHTML + "</div>";
} else if (document.URL.indexOf('?') != -1) {
alert('This is your usual scenario. Sorry to interrupt, but it really is normal.');
}
}

</script>

</head>
<body onload=' checkurl(); ' style='background-color:pink;'>

<h1 align='center'>Multiple Form Multiple Submit Buttons</h1>

<div align='center' style='background-color: yellow;'>
<form style='height:50px;background-color: green;float:top;' method='GET' action='./multiple_form_multiple_submit_buttons.html' id='myform1' target='mycif'>
<br><input type='submit' title='Normal submit of form' onclick='cif();' name='submit' id='submit' value='Validate'></input>  
<input type='reset' title='Clear the decks and start again' id='reset' value='Reset' onclick=" top.window.location.href='./multiple_form_multiple_submit_buttons.html'; "></input>
<input type='submit' title='Submit of form with email intervention' onclick='cif();' name='submitemail' id='submit1email' value='Validate and Email'></input>  
<input type='submit' title='Submit of form with interactive prompting' onclick='cif();' name='submitask' id='submit1ask' value='Validate and Ask'></input>  
<input type='submit' title='Submit of form to an embedded iframe' onclick='cif();' name='submitiframe' id='submit1iframe' value='Validate and Iframe'></input>  
</form>
<br><br>
<form style='height:180px;background-color: purple;float:right;' method='GET' action='./multiple_form_multiple_submit_buttons.html' id='myform2' target='mycif'>
<br><input type='submit' title='Submit of form with email intervention' onclick='cif();' name='submitemail' id='submitemail' value='Validate and Email'></input>  
<br><input type='reset' title='Clear the decks and start again' id='reset' value='Reset' onclick=" top.window.location.href='./multiple_form_multiple_submit_buttons.html'; "></input>
<br><input type='submit' title='Normal submit of form' onclick='cif();' name='submit' id='submit2' value='Validate'></input>  
<br><input type='submit' title='Submit of form with interactive prompting' onclick='cif();' name='submitask' id='submit2ask' value='Validate and Ask'></input>  
<br><input type='submit' title='Submit of form to an embedded iframe' onclick='cif();' name='submitiframe' id='submit2iframe' value='Validate and Iframe'></input>  
</form>
<form style='height:180px;background-color: orange;float:left;' method='GET' action='./multiple_form_multiple_submit_buttons.html' id='myform3' target='mycif'>
<br><input type='submit' title='Submit of form with interactive prompting' onclick='cif();' name='submitask' id='submitask' value='Validate and Ask'></input>  
<br><input type='reset' title='Clear the decks and start again' id='reset' value='Reset' onclick=" top.window.location.href='./multiple_form_multiple_submit_buttons.html'; "></input>
<br><input type='submit' title='Normal submit of form' onclick='cif();' name='submit' id='submit3' value='Validate'></input>  
<br><input type='submit' title='Submit of form with email intervention' onclick='cif();' name='submitemail' id='submit3email' value='Validate and Email'></input>  
<br><input type='submit' title='Submit of form to an embedded iframe' onclick='cif();' name='submitiframe' id='submit3iframe' value='Validate and Iframe'></input>  
</form>
<iframe id='mycif' name='mycif' src='./multiple_form_multiple_submit_buttons.html' style='width:70%;height:400px;background-color: pink;'></iframe>
<br><br>
<form style='height:50px;background-color: blue;float:bottom;' method='GET' action='./multiple_form_multiple_submit_buttons.html' id='myform4' target='mycif'>
<br><input type='submit' title='Submit of form to an embedded iframe' onclick='cif();' name='submitiframe' id='submitiframe' value='Validate and Iframe'></input>  
<input type='reset' title='Clear the decks and start again' id='reset' value='Reset' onclick=" top.window.location.href='./multiple_form_multiple_submit_buttons.html'; "></input>
<input type='submit' title='Normal submit of form' onclick='cif();' name='submit' id='submit4' value='Validate'></input>  
<input type='submit' title='Submit of form with email intervention' onclick='cif();' name='submitemail' id='submit4email' value='Validate and Email'></input>  
<input type='submit' title='Submit of form with interactive prompting' onclick='cif();' name='submitask' id='submit4ask' value='Validate and Ask'></input>  
</form>
</div>

</body>
</html>