<html>
<head>
<title>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('myif');
if (oif != null) {
oif.style.display='block';
odiv=document.getElementById('mydiv');
odiv.style.display='none';
}
}

function checkurl() {
oif=document.getElementById('myif');
if (oif != null) {
var oform=document.getElementById('myform');
oform.target='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_submit_buttons.html' style='width:100%;height:1200px;display:block;'></iframe><div id='mydiv' align='center' style='display:none;'>" + 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'>Form Multiple Submit Buttons</h1>

<div align='center'>
<form method='GET' action='./multiple_form_submit_buttons.html' id='myform'>
<input type='submit' title='Normal submit of form' onclick='cif();' name='submit' id='submit' value='Validate'></input>&nbsp;&nbsp;
<input type='submit' title='Submit of form with email intervention' onclick='cif();' name='submitemail' id='submitemail' value='Validate and Email'></input>&nbsp;&nbsp;
<input type='submit' title='Submit of form with interactive prompting' onclick='cif();' name='submitask' id='submitask' value='Validate and Ask'></input>&nbsp;&nbsp;
<input type='submit' title='Submit of form to an embedded iframe' onclick='cif();' name='submitiframe' id='submitiframe' value='Validate and Iframe'></input>&nbsp;&nbsp;
<input type='reset' title='Clear the decks and start again' id='reset' value='Reset' onclick=" top.window.location.href='./multiple_form_submit_buttons.html'; "></input>
</form>
</div>

</body>
</html>