Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>You can do with php, extract state of fields with environment php variables, you just make an formular and send some data to your webserver script-file.</p> <pre><code>&lt;?php $confirm = $_POST["name_of_the_button"] if(isset($confirm)) { some script } else { other script } </code></pre> <p><strong>-----EDIT-----:</strong></p> <p>I made it with two files:</p> <p><strong>File: form.php</strong></p> <pre><code>&lt;html&gt; &lt;head&gt; &lt;title&gt;Button test&lt;/title&gt; &lt;script type="application/javascript"&gt; function ajaxObj() { var xmlHttp=null; try { // Browsers Firefox, Opera 8.0+, Safari; xmlHttp=new XMLHttpRequest(); } catch(e) { try { // Browser Internet Explorer; xmlHttp=new ActiveXObject("Msxml2.XMLHTTP"); } catch(e) { try { // Other browsers xmlHttp=new ActiveXObject("Microsoft.XMLHTTP"); } catch(e) { // Your browser does not suport XMLhttp object alert('Your browser does not suport XMLhttp object'); return false; } } } return xmlHttp; } function doQuery(id) { xmlHttp=ajaxObj(); if(xmlHttp==null) { alert('Your browser does not suport XMLhttp object'); return; } xmlHttp.open("POST","check.php",true); var send = 'id='+id; xmlHttp.onreadystatechange=function() { if (xmlHttp.readyState==4 &amp;&amp; xmlHttp.status==200) { document.getElementById("output").innerHTML=xmlHttp.responseText; } } xmlHttp.setRequestHeader("Content-type","application/x-www-form-urlencoded"); xmlHttp.send(send); } &lt;/script&gt; &lt;/head&gt; &lt;body&gt; &lt;button id="confirmed" name="button" onclick="doQuery(this.id)"&gt;Confirm&lt;/button&gt; &lt;button id="declined" name="button" onclick="doQuery(this.id)"&gt;Decline&lt;/button&gt; &lt;div id="output"&gt;&lt;/div&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p><strong>File check.php:</strong></p> <pre><code>&lt;?php $action = $_POST["id"]; $confirm = false; if($action=="confirmed") $confirm = true; else if($action=="declined") $confirm = false; else {} ?&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload