Refreshing a Menu

A

Angelos

Hello anyone knows a good way to refresh a DropDown Select Menu after it has
been updated ?

It is a PHP dynamic populated menu. The user has the option to add a new
category So he clicks the Add new category button and once it is added I go
back in history <script language="javascript"
type="text/javascript">history.go(-2);</script> Which is not the most
appropriate way I suppose.
And the menu in the form just needs a refresh to get the new values..
Any ideas of how to do that ?

Here is the code..
If you didn't understand what I am trying to do, let me know ! Thanks for
that
<td>
<select name="products_category_id"><?php
do { ?>
<option value="<?php echo
$row_rs_product_categories['product_categories_id']?>">
<?php echo
$row_rs_product_categories['product_categories_name']?></option>
<?php
} while ($row_rs_product_categories =
mysql_fetch_assoc($rs_product_categories));
$rows = mysql_num_rows($rs_product_categories);
if($rows > 0)
{
mysql_data_seek($rs_product_categories, 0);
$row_rs_product_categories = mysql_fetch_assoc($rs_product_categories);
}
?>
</select>
<a href="content.php?action=add&contCat=product_categories">add Category</a>
(Please Click
<a href="javascript:history.go(0)">refresh categories</a>) </td>
 
B

bmgz

Angelos said:
Hello anyone knows a good way to refresh a DropDown Select Menu after it has
been updated ?

What I did is have a checkbox next to the select menu. The checkbox
simply has a description next to it saying "add new category". When I
check the checkbox, the select menu is hidden and a text input is put in
it's place. You can uncheck the checkbox and you will be presented with
the select menu again. The next time I load the page, the new category
will be in the select menu as it is extracted from the
database(php/mysql- but this is irrelevant)..
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,584
Members
45,075
Latest member
MakersCBDBloodSupport

Latest Threads

Top