Note that there are some explanatory texts on larger screens.

plurals
  1. POPassing multiple value in ajax using <a> tag, and retrieving a value that was submitted
    primarykey
    data
    text
    <p>This is a very simple function if one where to use an input tag, unfortunately i have to use a link tag since i'm working with alphabet grouping that would retrieve the values on a different page.</p> <p>here's a code i found for link tag to hold a value to be submitted to ajax</p> <pre><code>echo '&lt;a onclick="passPagination(\'3\');passLetter(\'S\')"&gt;NEXT&lt;/a&gt;'; </code></pre> <p>i want to call all letters "s" page "3" from the other page.</p> <pre><code> function passLetter(str) { if (str=="") { document.getElementById("retail_group").innerHTML=""; return; } if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari xmlhttp=new XMLHttpRequest(); } else {// code for IE6, IE5 xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); } xmlhttp.onreadystatechange=function() { if (xmlhttp.readyState==4 &amp;&amp; xmlhttp.status==200) { document.getElementById("retail_group").innerHTML=xmlhttp.responseText; } } xmlhttp.open("GET","otherpage.php?letter="+str,true); xmlhttp.send(); } function passPagination(str) { if (str=="") { document.getElementById("retail_group").innerHTML=""; return; } if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari xmlhttp=new XMLHttpRequest(); } else {// code for IE6, IE5 xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); } xmlhttp.onreadystatechange=function() { if (xmlhttp.readyState==4 &amp;&amp; xmlhttp.status==200) { document.getElementById("retail_group").innerHTML=xmlhttp.responseText; } } xmlhttp.open("GET","otherpage.php?pageno="+str,true); xmlhttp.send(); } </code></pre> <p>also i want to call again the letter that was passed to the otherpage so that i would make it as a reference for my pagination links that is also being hold in this page. echo 'NEXT';</p> <p>i am really at lost here since i am not familiar with link tag and ajax working together, also as you may have noticed i am not also that good with ajax judging from my very long ajax code.</p> <p>Your help is greatly appreciated, Thank You.</p> <p>i am really new at ajax. :)</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.
 

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