Note that there are some explanatory texts on larger screens.

plurals
  1. POjQuery .change() not working on textarea
    text
    copied!<p>This is my first time asking on StackOverflow, but I'm currently stumped with some corporate code I'm creating. It will simply not accept the .change() or bind to keyup. I've haven't had a problem before with it, but it ceases to work for me today. Check out my code and see if you see anything that might cause a problem.</p> <p>Sorry about the formatting, I'm new.</p> <pre><code>var currentContent = "null"; var customeri = ""; var optionsi = ""; var equipmenti = ""; var picturei = ""; $(document).ready(function() { $("#preview").hide(); $("#previewPane").hide(); $("#previewHeading").hide(); $(".uiFonts").click(function() { var clickedID = $(this).attr("id"); if(clickedID !== null) { $("#main").hide(); loadContent(clickedID); } }); $("#Equipment").bind('change keyup', function() { equipmenti = $(this).val(); $("#preview").html('&lt;br /&gt;&lt;span class="reg"&gt;Customer Info&lt;br /&gt;&lt;/span&gt;'+customeri+'&lt;br /&gt;&lt;br /&gt;&lt;span class="reg"&gt;Options&lt;br /&gt;&lt;/span&gt;'+optionsi+'&lt;br /&gt;&lt;br /&gt;&lt;span class="reg"&gt;Equipment&lt;br /&gt;&lt;/span&gt;'+equipmenti+'&lt;br /&gt;&lt;br /&gt;&lt;span class="reg"&gt;Picture:&lt;br /&gt;&lt;/span&gt;&lt;img src="'+picturei+'" /&gt;'); }); }); function loadContent(cID) { $("#main").load(cID + ".html", function() { $("#main").slideDown(1500); $("#preview").fadeIn(1500); $("#previewPane").fadeIn(1500); $("#previewHeading").fadeIn(1500); currentContent = cID; }); } </code></pre> <p>.html file containing textareas is as follows:</p> <pre><code>&lt;p&gt;&lt;span class="reg"&gt;Customer Info - Name, Address, Phone, Email&lt;/span&gt;&lt;br /&gt; &lt;textarea name="Customer Info" class="textAreas inputs" id="Customer"&gt;&lt;/textarea&gt; &lt;br /&gt; &lt;br /&gt; &lt;span class="reg"&gt;Trailer Options&lt;/span&gt; &lt;br /&gt; &lt;textarea name="Options" class="inputs textAreas" id="Options"&gt;&lt;/textarea&gt; &lt;br /&gt; &lt;br /&gt; &lt;span class="reg"&gt;Trailer Equipment&lt;/span&gt; &lt;br /&gt; &lt;textarea name="Equipment" class="inputs textAreas" id="Equipment"&gt;&lt;/textarea&gt; &lt;br&gt; &lt;br&gt; &lt;span class="reg"&gt;Picture URL&lt;/span&gt;&lt;/p&gt; &lt;input type="text" id="picture" class="inputs"&gt;&lt;/input&gt; </code></pre> <p>And I have tried binding them in general like:</p> <pre><code>$(".inputs").change(function() { customeri = $("#Customer").val(); optionsi = $("#Options").val(); //etc </code></pre>
 

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