473,326 Members | 2,655 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

Refreshing a Menu

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_categ ories">add Category</a>
(Please Click
<a href="javascript:history.go(0)">refresh categories</a>) </td>
Jul 23 '05 #1
2 1067
Angelos wrote:
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)..
Jul 23 '05 #2

Any value coming for the server, will require a served data from it an
will do a reload, so, do specify a bit more what are the values and how
are they defined. You can preload them in an array to js through PHP
outputting them and then have js do the array manipulation, but depends on
what you specifically are doing.

Danny
On Thu, 23 Jun 2005 02:40:32 -0700, Angelos <an*****@redcatmedia.net>
wrote:
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_categ ories">add
Category</a>
(Please Click
<a href="javascript:history.go(0)">refresh categories</a>) </td>


--
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/
Jul 23 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: John Ortt | last post by:
I appologise for reposting this but I have been trying to find a solution all week with no avail and I was hoping a repost might help somebody more knowledgable than myself to spot the message... ...
2
by: PJSimon | last post by:
I have a system tray icon for my application. Each time the user pastes some text into the application, I add a submenu item in the system tray's context menu. The first time I right-click the icon...
2
by: millertime90 | last post by:
Hi basically my problem is I have 2 drop down menus populated by my database the first populated by a field in the database and the 2nd populated with a relation to the value selected in the first...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.