dynamic dropdown and redirecting to new page
Hello,
I am trying to use my drop down menu so I can link to a new webpage.
I have created two tables in mysql, And I want the customer to be able to click a Button once the child dropdown menu is selected and go to the next page.
CREATE TABLE `categories` (
`cat_id` mediumint(8) unsigned NOT NULL auto_increment,
`cat_name` varchar(28) default NULL,
PRIMARY KEY (`cat_id`)
) ENGINE=MyISAM;
CREATE TABLE `companies` (
`comp_id` int(10) unsigned NOT NULL auto_increment,
`comp_name` varchar(48) NOT NULL,
`comp_cat_id` mediumint(8) unsigned NOT NULL,
PRIMARY KEY (`comp_id`)
) ENGINE=MyISAM;
INSERT INTO `categories` (`cat_id`, `cat_name`)
VALUES (1, 'Air Conditioning & Heating');
INSERT INTO `categories` (`cat_id`, `cat_name`)
VALUES (2, 'Alarm/Security');
INSERT INTO `categories` (`cat_id`, `cat_name`)
VALUES (3, 'Appliances');
INSERT INTO `categories` (`cat_id`, `cat_name`)
VALUES (4, 'Carpet & Upholstery Cleaning');
INSERT INTO `categories` (`cat_id`, `cat_name`)
VALUES (5, 'Day Care');
INSERT INTO `categories` (`cat_id`, `cat_name`)
VALUES (6, 'Electrical');
INSERT INTO `categories` (`cat_id`, `cat_name`)
VALUES (7, 'Energy Savers');
INSERT INTO `categories` (`cat_id`, `cat_name`)
VALUES (8, 'Fence & Deck Services');
INSERT INTO `categories` (`cat_id`, `cat_name`)
VALUES (9, 'Flooring');
INSERT INTO `categories` (`cat_id`, `cat_name`)
VALUES (10, 'Foundation Repair');
INSERT INTO `categories` (`cat_id`, `cat_name`)
VALUES (11, 'Garden & Landscaping');
INSERT INTO `categories` (`cat_id`, `cat_name`)
VALUES (12, 'Home Entertainment');
INSERT INTO `categories` (`cat_id`, `cat_name`)
VALUES (13, 'Home Furniture');
INSERT INTO `companies` (`comp_id`, `comp_name`, `comp_cat_id`)
VALUES (1, '1st Class Air Service', 1);
INSERT INTO `companies` (`comp_id`, `comp_name`, `comp_cat_id`)
VALUES (2, 'Chapman Air', 1);
INSERT INTO `companies` (`comp_id`, `comp_name`, `comp_cat_id`)
VALUES (3, 'Dallas Plumbing Company', 1);
And my dynamic dropdown script is
<div id="steps">
<div class="stepone">
<h4> Step One: </h4>
<p>Choose a Category</p>
<form id="form1" name="form1" method="post" action="">
<select name="Parent" id="Parent" onchange="WA_FilterAndPopulateSubList(Child_WAJA,MM_findObj('Parent'),MM_findObj('Child'),0,0,false,': ')">
<?php
do {
?>
<option value="<?php echo $row_Parent['cat_id']?>"><?php echo $row_Parent['cat_name']?></option>
<?php
} while ($row_Parent = mysql_fetch_assoc($Parent));
$rows = mysql_num_rows($Parent);
if($rows > 0) {
mysql_data_seek($Parent, 0);
$row_Parent = mysql_fetch_assoc($Parent);
}
?>
</select>
</form>
<p> </p>
</div>
<div class="stepone">
<h3> Step Two:</h3>
<p> Choose a Company (Optional) </p>
<form id="form2" name="form2" method="post" action="">
<select name="Child" id="Child">
</select>
</form>
<p> </p>
</div>
<div class="stepone">
<h2> Step Three:</h2>
<img class="go" src="images/global images/gobutton.png" alt="Go" />
</div>
</div>
I was wondering if I need to create another column in my table that holds the URL for all those companies and how do I make the GO button recall that column in the table and open the new page?