Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>If you really need to submit the values over multiple .php files, and the require option gave by dqhendricks does not solve it, why not to use several Ajax calls? One for each file.</p> <p>You could have something like this:</p> <pre><code>&lt;form onsubmit='sendSeveralPost()'&gt; ... form fields &lt;/form&gt; </code></pre> <p>And the javascript function</p> <pre><code>function sendSeveralPost() { var f1 = document.getElementById('field1'); var f2 = document.getElementById('field2'); var x = getXmlHttp(); var params = 'field1='+f1+'&amp;field2='+f2; x.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); x.setRequestHeader("Content-length", params.length); x.setRequestHeader("Connection", "close"); var files = new Array(); files[0] = 'script1.php'; files[1] = 'script2.php'; files[2] = 'script3.php'; for (i=0;i&lt;files.lenght;i++) { var url = files[i]; x.open("POST", url, true); x.onreadystatechange = function() {//Call a function when the state changes. if(x.readyState == 4 &amp;&amp; x.status == 200) { alert(x.responseText); } } x.send(params); } } function getXmlHttp() { var xmlHttp; try { // Firefox, Opera 8.0+, Safari xmlHttp=new XMLHttpRequest(); } catch (e) { try { // Internet Explorer 6.0+ xmlHttp=new ActiveXObject("Msxml2.XMLHTTP"); } catch (e){ try { // Internet Explorer 5.5 xmlHttp=new ActiveXObject("Microsoft.XMLHTTP"); } catch (e){ alert("Your browser does not support AJAX!"); return false; } } } return xmlHttp; } </code></pre> <p>Further explanations about the commands can be found at the article <a href="http://www.openjs.com/articles/ajax_xmlhttp_using_post.php" rel="nofollow">http://www.openjs.com/articles/ajax_xmlhttp_using_post.php</a>, from where I took the inspiration for this example.</p> <p>Hope this helps.</p> <p>Namastê!</p>
    singulars
    1. This table or related slice is empty.
    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