Note that there are some explanatory texts on larger screens.

plurals
  1. POjavascript bound to a button inside a form created using ajax not firing
    primarykey
    data
    text
    <p>so an html form is created dynamically using ajax. inside the html form there's a button which has it's onclick event bound to some javascript. the javascript is fired successfully in FF, Opera, IE but not in chrome where nothing happens. Any idea what the problem might be??</p> <pre><code> &lt;div id="s"&gt; &lt;input type="button" class="button" value="reply" onclick="comment()"/&gt; &lt;/div&gt; function comment() { var xmlhttp; if (window.XMLHttpRequest) { xmlhttp=new XMLHttpRequest(); } else { xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); } xmlhttp.onreadystatechange=function() { if (xmlhttp.readyState==4 &amp;&amp; xmlhttp.status==200) { document.getElementById("s").innerHTML=xmlhttp.responseText; } } xmlhttp.open("post","replyForm.php",true); xmlhttp.send(); } function remove() { var xmlhttpp; if (window.XMLHttpRequest) { xmlhttpp=new XMLHttpRequest(); } else { xmlhttpp=new ActiveXObject("Microsoft.XMLHTTP"); } xmlhttpp.open("post","replyButton.php",true); xmlhttpp.send(); xmlhttpp.onreadystatechange=function() { if (xmlhttpp.readyState==4 &amp;&amp; xmlhttpp.status==200) { document.getElementById("s").innerHTML=xmlhttpp.responseText; } } } </code></pre> <p>replyForm.php</p> <pre><code> &lt;?php echo("&lt;script type='text/javascript' src='validation.js'&gt;&lt;/script&gt;"); echo("&lt;input type=SUBMIT name=INS value='Submit' class='button' /&gt; &lt;input type='button' class ='button' value='Cancel' onclick=\"remove()\"/&gt; &lt;INPUT TYPE=RESET NAME=RES VALUE='Clear' class='button' /&gt;"); ?&gt; </code></pre> <p>replyButton.php</p> <pre><code> &lt;?php echo("&lt;script type='text/javascript' src='validation.js'&gt;&lt;/script&gt;"); echo("&lt;input type='button' class='button' value='reply' onclick='comment()'&gt;"); ?&gt; </code></pre>
    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.
 

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