Wrox Programmer Forums
Go Back   Wrox Programmer Forums > PHP/MySQL > PHP How-To
|
PHP How-To Post your "How do I do this with PHP?" questions here.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the PHP How-To section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old February 7th, 2006, 12:45 PM
Registered User
 
Join Date: Feb 2006
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default changing content depending on combo box value

Hi all,
just wondering if any1 know how i could do the following:

display different content depending on the value of a combo box. The content should be displayed automatically after the value of the combo box is choosen.

Cheers

 
Old September 13th, 2006, 11:57 AM
Registered User
 
Join Date: Sep 2006
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi,
I am a new commer, and late commer also, I think.
Anyway, the problem you are saying about, I think, is the jump menu. I usally do it by javascript. Here is the script below. Put this script in the header within a script tag.

function jumpMenu(targ,selObj,restore){
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}

Here is the HTML code for menue.

<form>
 <select name="menu1" onchange="jumpMenu('parent',this,0)">
  <option value="0">Select</option>
  <option value="index.php">Index</option>
  <option value="product.php">Product</option>
  <option value="price.php">Price</option>
 </select>
</form>

Please let me know whether it works.

Regards,
Zia.






Similar Threads
Thread Thread Starter Forum Replies Last Post
Combo box to display items from parent combo box Gini Visual Studio 2008 0 June 18th, 2008 12:30 AM
Different subforms depending on combo box choice stevensj5 Access 5 October 3rd, 2007 08:54 PM
Combo box choice creating filtered combo box stevensj5 Access 11 September 13th, 2007 11:33 AM
Size of text box depending on size of another box AstridVM BOOK: Access 2003 VBA Programmer's Reference 0 March 7th, 2007 06:24 AM
Choosing content depending on content of other ele dsekar_nat XSLT 1 February 27th, 2006 05:58 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.