Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Javascript > making 2 dropdowns after select refresh

Reply
Thread Tools

making 2 dropdowns after select refresh

 
 
Wouter
Guest
Posts: n/a
 
      08-27-2005
Hi,

I would like to make a dropdown menu. When a user select something i want to
use his selection in PHP for a next dropdown menu. When the user has
selected something in the second dropdown menu i know then what i most show
for data.

If have make one drop down menu but i dont know how i can use the selection
in PHP. I think i'm using the wrong javascript. But i dont know what i
need....

I have the follow code:

<?php
$db = mysql_connect ($dbhost_hostel, $dbuser_hostel, $dbpasswd_hostel) or
die ("Verbindeing mislukt");
mysql_select_db($dbname_hostel, $db);
$query = "SELECT DISTINCT(land) FROM hostel WHERE validate='1'";
$res = mysql_query($query);
$hostel = mysql_fetch_array($res);
?>

<SCRIPT type="text/javascript" LANGUAGE="JavaScript">
<!--
var d = document;
d.write("<form name='goLand'>");
d.write("<select name='goland' size=1 class=input
onchange='window.location=d.goLand.goland.options[d.goLand.goland.selectedIndex].value'>");
d.write("<option value='#' selectED>Menu");
<?php while($hostel = mysql_fetch_array($res)){ ?>
d.write("<option value='<?php echo $hostel['land'];?>'><?php echo
$hostel['land'];?>");
<?php } ?>
d.write("<\/select>");
d.write("<\/form>");
//-->
</script>

<?php } ?>

For exemple: http://www.backpack.nu/content/verblijf/verblijf/0/ (below)

Can someone help how i can make this ?
Greets Wouter


 
Reply With Quote
 
 
 
 
Wouter
Guest
Posts: n/a
 
      08-27-2005
I have already fix the problem! The problem was mod_rewrite.

Greets

"Wouter" <laptop@_NOSPAM.com> schreef in bericht
news:43106a4f$0$69741$(E-Mail Removed)...
> Hi,
>
> I would like to make a dropdown menu. When a user select something i want
> to use his selection in PHP for a next dropdown menu. When the user has
> selected something in the second dropdown menu i know then what i most
> show for data.
>
> If have make one drop down menu but i dont know how i can use the
> selection in PHP. I think i'm using the wrong javascript. But i dont know
> what i need....
>
> I have the follow code:
>
> <?php
> $db = mysql_connect ($dbhost_hostel, $dbuser_hostel, $dbpasswd_hostel) or
> die ("Verbindeing mislukt");
> mysql_select_db($dbname_hostel, $db);
> $query = "SELECT DISTINCT(land) FROM hostel WHERE validate='1'";
> $res = mysql_query($query);
> $hostel = mysql_fetch_array($res);
> ?>
>
> <SCRIPT type="text/javascript" LANGUAGE="JavaScript">
> <!--
> var d = document;
> d.write("<form name='goLand'>");
> d.write("<select name='goland' size=1 class=input
> onchange='window.location=d.goLand.goland.options[d.goLand.goland.selectedIndex].value'>");
> d.write("<option value='#' selectED>Menu");
> <?php while($hostel = mysql_fetch_array($res)){ ?>
> d.write("<option value='<?php echo $hostel['land'];?>'><?php echo
> $hostel['land'];?>");
> <?php } ?>
> d.write("<\/select>");
> d.write("<\/form>");
> //-->
> </script>
>
> <?php } ?>
>
> For exemple: http://www.backpack.nu/content/verblijf/verblijf/0/ (below)
>
> Can someone help how i can make this ?
> Greets Wouter
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
select box - using refresh to select same item twice entfred@hotmail.com Javascript 2 07-25-2006 11:54 PM
trying to update a table after making a join select query on two tables rob merritt ASP .Net Datagrid Control 0 03-01-2005 10:33 PM
select of select box will select multiple in another box palmiere Javascript 1 02-09-2004 01:11 PM
dropdowns on some IE browsers don't refresh from cache Jason Shohet ASP .Net 1 12-11-2003 04:50 PM
Page Post Back -- how to retain selecteditem.value of TWO dropdowns??? KathyB ASP .Net 6 06-27-2003 03:33 PM



Advertisments