Page 1 of 1

Dropdown Select

Posted: Thu Jun 14, 2012 8:16 pm
by jayson.ph
Hi all,

Can i request for help, i have a drop-down ff. => http://i48.tinypic.com/35a3vqa.jpg and my preoblem now is SELECTING FROM LIST. i know you are all familiar from this. i just like, when i was select category: netbook-> the next paroduct name: all netbook product will be available to select. :

I have code for selecting category, but the next product name, i reallt have no idea, what to do.

Code: Select all

$query = "SELECT cat_name FROM tbl_category";
			$x = mysql_query($query);
			echo "Category: <select name = 'slc_inbranch'>";
				while($v = mysql_fetch_array($x))
			{
			echo "<option value = $v[cat_name]> $v[cat_name]</option>";
			}
			echo "</select>";


Please help, very needed..

Re: Dropdown

Posted: Thu Jun 14, 2012 8:21 pm
by Celauran
I'm guessing you want each dropdown to refine the choices available in the next? If so, you'll want an AJAX solution. How are you currently approaching the problem? Where are you running into problems? Can you post some code?

Re: Dropdown Select

Posted: Thu Jun 14, 2012 8:32 pm
by jayson.ph
ah yes, and i use your code to validate username and passwrd.. thank a lot, can you help me.. regarding the dropdwn. and after this project, i show you all.

Re: Dropdown Select

Posted: Thu Jun 14, 2012 8:42 pm
by jayson.ph
i forgot the Category table. here: http://i50.tinypic.com/fmm7br.jpg

Re: Dropdown Select

Posted: Thu Jun 14, 2012 8:44 pm
by Celauran
Essentially what you want is to have a jQuery listener on each of those select boxes. When the selected item changes, use $.post() to query the database asynchronously.

Re: Dropdown Select

Posted: Thu Jun 14, 2012 8:58 pm
by jayson.ph
Ah no, simply i need the list product base in category selected.

Re: Dropdown Select

Posted: Fri Jun 15, 2012 8:58 pm
by jayson.ph
Please help, a little idea regarding drop-down.
example: when i select category like-> laptop the next selection on product name: all kinds of laptop will be appear on the product name.

Please i really need help..

Re: Dropdown Select

Posted: Sat Jun 16, 2012 10:39 am
by Celauran
jayson.ph wrote:when i select category like-> laptop the next selection on product name: all kinds of laptop will be appear on the product name.
That's what I was talking about initially and you said no.

Do you have any familiarity with AJAX? jQuery?

Re: Dropdown Select

Posted: Sat Jun 16, 2012 10:23 pm
by jayson.ph
ah okay, sorry... but do you have a sample to show me, and i try to learn it. please