Note that there are some explanatory texts on larger screens.

plurals
  1. POAJAX + PHP self-generated fields producing blank results
    primarykey
    data
    text
    <p>I'm back and this one might be a little tricky but we will find out! :D</p> <p>Okay I am using php to self populate my <code>select</code> fields so I don't have to continuously update the <code>options</code> when new agents join. I am using ajax (javascript) for this part of the page and I have had no problems with this except with the company <code>select</code> field.</p> <p><a href="http://healthbenefitsohio.com/advance.php" rel="nofollow">Live site</a></p> <p>All my <code>select</code> fields work with out any problems but the Company field which will display nothing only on companies that seem to have "&amp;" in the name. (Two companies still work with "&amp;" in the name)</p> <p>List of non-functioning Companies:<br /> -Anthem<br /> -Bogart<br /> -Burnham<br /> -Church Insurance<br /> -Fawcett<br /> -JRM<br /> -Kenneth B. Brown<br /> -Newton<br /> -Sam F.<br /> -Sherrill<br /> -Wallace &amp; Turner</p> <p>PHP Company <code>select</code> code: (The if/else statement in the companies field would ideally be <code>if ($row['Company'] !== NULL) { echo '&lt;option value="'.$row['Company'].'"&gt;'.$row['Company'].'&lt;/option&gt;'; }</code> but for some reason it will echo in a blank space in the <code>option</code> dropdown.)</p> <pre><code>&lt;label for="company"&gt;Company&lt;/label&gt;&lt;br /&gt; &lt;select id="company" name="users" onChange="showUser(this.value)"&gt; &lt;?php include 'login.php'; $result = mysqli_query($con, "SELECT DISTINCT Company FROM `roster` ORDER BY Company ASC;"); echo '&lt;option value=""&gt;' . 'Select a Company' .'&lt;/option&gt;'; while ($row = mysqli_fetch_array($result)) { if ($row['Company'] == NULL) { } else { echo '&lt;option value="'.$row['Company'].'"&gt;'.$row['Company'].'&lt;/option&gt;'; } } ?&gt; &lt;/select&gt; </code></pre> <p>PHP for other <code>select</code> fields:</p> <pre><code>&lt;label for="last"&gt;Last Name&lt;/label&gt;&lt;br /&gt; &lt;select id="last" name="Last_Name" onChange="showUser(this.value)"&gt; &lt;?php include 'login.php'; $result = mysqli_query($con, "SELECT DISTINCT Last_Name FROM `roster` ORDER BY Last_Name ASC;"); echo '&lt;option value=""&gt;' . 'Select an Agent' .'&lt;/option&gt;'; while ($row = mysqli_fetch_array($result)) { echo '&lt;option value="'.$row['Last_Name'].'"&gt;'.$row['Last_Name'].'&lt;/option&gt;'; } ?&gt; &lt;/select&gt; </code></pre> <p>Any Ideas on this one? If you need to see the process.php page which echos in the results then just ask! Thanks a million to anyone who helps out.</p> <p>How the HTML looks when populated through php:</p> <pre><code>&lt;select id="company" name="users" onchange="showUser(this.value)"&gt; &lt;option value=""&gt;Select a Company&lt;/option&gt;&lt;option value="A.R.T. Group"&gt;A.R.T. Group&lt;/option&gt;&lt;option value="ALPHA Benefits"&gt;ALPHA Benefits&lt;/option&gt; &lt;/select&gt; </code></pre> <p>I only included a few since 80ish of them is one massive line of html.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    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