close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

dynamic dropdown and redirecting to new page

Thread began 3/05/2010 9:47 am by nvdhassani382788 | Last modified 3/08/2010 11:44 am by nvdhassani382788 | 6142 views | 5 replies

nvdhassani382788

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>&nbsp;</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>&nbsp;</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?

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...