A Question Regarding <select> and <option> Value!

Hello, guys! Just a small first ever thread, where I ask a question where I hope anyone is able to help me out :slight_smile:

I am working on a project with a friend of mine for a company. I have a problem with the function on a form.
I wonder; How do i change the option value of a form? Let’s say if I choose a category like “Cake”, I want the second drop down box to display different brands of cake. But if I choose bicycle for example, I want the option values to be different brands of bicycles. I hope you guys understand what I was trying to say here.
Anyways, here is a sample image where I want this function to occur:

Sample:

Cheers and thanks in advance,
Marius

Well, without seeing any of your code… First, there are many ways of doing this.

One way, just use PHP code and post the form to another page which would load the second drop-down based on the setting of the first one.

Another way would be to “dynamically” load the second one from Javascript or Jquery. This would be nicer looking since the page will not “refresh” itself when it posts out to the second page. This, of course, is more complicated.

A third way would be to have a hidden iFrame and load your second PHP page into that. Then, you could just copy the data with Javascript to the current drop-down.

So, there are 3 ways to do it. Pick one and do a little reading with your buddy, Google. Then, ask your questions here and we will help you out. Good luck…

Sponsor our Newsletter | Privacy Policy | Terms of Service