Note that there are some explanatory texts on larger screens.

plurals
  1. POjquery id selector echoed php? not working
    primarykey
    data
    text
    <pre><code> //play.php echo' &lt;div id="new_char" style="text-align:center; position:relative; top: 100px;"&gt;&lt;center&gt; You do not have a character! &lt;br&gt; Make one...&lt;br&gt;&lt;br&gt; &lt;form method="post" &gt; Character Name: &lt;input type="text" name="name" size="25"&gt; &lt;br&gt; Class: &lt;select name="class"&gt; '; $classinfo = "select * from classes"; $classinfo2 = mysql_query($classinfo) or die("could not select classes"); while($classinfo3 = mysql_fetch_array($classinfo2) ) { echo"&lt;option&gt;$classinfo3[type]&lt;/option&gt;"; } echo' &lt;/select&gt;&lt;br /&gt; &lt;div id="new_char_error"&gt; &lt;/div&gt; &lt;br /&gt; &lt;input id="make_char" type="submit" value="submit"&gt; &lt;/form&gt; &lt;table border="0" cellspacing="30"&gt; &lt;tr&gt;&lt;td valign="top"&gt; &lt;/td&gt; &lt;td valign="top" &gt; &lt;b style="text-align:center;"&gt;Class Starting Modifiers&lt;/b&gt; '; $selectclass="select * from classes"; $selectclass2=mysql_query($selectclass) or die("couldnt get classes"); echo' &lt;table border="1" bordercolor="black" bgcolor="#fffffff"&gt; &lt;tr&gt;&lt;td font color="cc0033"&gt; Class &lt;/td&gt; &lt;td font color="cc0033"&gt; Attack &lt;/td&gt; &lt;td font color="cc0033"&gt; Defense &lt;/td&gt; &lt;td font color="cc0033"&gt; Endurance &lt;/td&gt; &lt;/tr&gt; &lt;br&gt; '; while($selectclass3=mysql_fetch_array($selectclass2)) { echo " &lt;tr&gt;&lt;td&gt; $selectclass3[type]&lt;/td&gt; &lt;td&gt; $selectclass3[attack]&lt;/td&gt; &lt;td&gt; $selectclass3[defense]&lt;/td&gt; &lt;td&gt; $selectclass3[maxendurance]&lt;/td&gt; &lt;/tr&gt;"; } echo' &lt;/table&gt; &lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/center&gt; &lt;/div&gt; '; &lt;script&gt; $("#make_char").click(function() { $.ajax({ url:'character_scripts/new_char.php', success: function(data) { $('#new_char_error').html(data); } }); }); &lt;/script&gt; </code></pre> <p>Is it possible to use a div that is echoed through php as a jquery selector? I have a form that is not being submitted when the submission is clicked. All the code on new_char.php looks good. Ive tested all the loops and possible variation of the codes structure during runtime, all I can think of is that jquery can not use a selector that is echoed in php. but Im not that familiar with jquery and did not find the answer when searching online.</p> <p>ps: The function is a separate file and that is not the entire files posted, (to conserve space)</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.
 

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