Forums

This topic is locked

ListBox disappears after Submit

Posted 09 Mar 2007 20:50:58
1
has voted
09 Mar 2007 20:50:58 Nancy Renfree posted:
<font face='Comic Sans MS'>I have created a PHP page where the user clicks on a word in a ListBox containing a list of words retrieved from a MySQL database. When the user clicks a word, a picture representing that word appears on another part of the screen.

Clicking the word submits the form the ListBox is a part of and sends a URL variable that is used to get a value from another SQL table that is used to create the source path to the image.

When the word is clicked, the list of words disappears. I would REALLY like the list to stay visible so the user can click another word if they wish.

Here is the code for the listbox:

<pre id=code><font face=courier size=2 id=code>&lt;select name="vocabList" size="10" class="style5" id="vocabList" onchange="MM_setTextOfTextfield('vocabWrdChosen','',''+(vocabList[vocabList.selectedIndex].text)+'');document.frmWrdList.submit()"&gt;
&lt;?php
do {
?&gt;
&lt;option value="&lt;?php echo $row_wrdList['picID']?&gt;"&gt;&lt;?php echo $row_wrdList['vocabWord']?&gt;&lt;/option&gt;
&lt;?php
} while ($row_wrdList = mysql_fetch_assoc($wrdList));
$rows = mysql_num_rows($wrdList);
if($rows &gt; 0) {
mysql_data_seek($wrdList, 0);
$row_wrdList = mysql_fetch_assoc($wrdList);
}
?&gt;
&lt;/select&gt;</font id=code></pre id=code>

This must be possible. As someone just learning, I haven't been able to find the answer.

Any suggestions?

Thank you so much for your help,

Nancy


</font id='Comic Sans MS'>

Reply to this topic