If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

Enjoy an ad free experience by logging in. Not a member yet? Register.

That looks like a job for javascript. PhP can build all the inputs and dropdowns, javascript would have no problem placing the dropdown choices in the inputs. Javascript could read all the choices from many types of inputs, building an array of them, putting the array in a hidden input, and letting the array be posted to PhP, where the whole array could be used by PhP.

Bare in mind, you can't have option/inputs together like that. Options are children of select boxes, so you have to wrap those options within selects, with the inputs outside.

But yah, if you want dynamic action, you need Javascript. Remember that PHP is server side. When a user requests a page, PHP processes it and does w/e and sends that information back to the client. It then has no further interaction until the next request. Thus, changing the page ad infinitum would make no difference to the PHP. Javascript on the other hand works on the client side... it makes dynamic changes to the client's view, without ever needing to interact with the server.

Okay mind showing me the many options code? So what if I have Audi, BMW, Mercedes, Toyota, Honda, Ferrari?

Surely you can manage that yourself? Six options is not what I would call "many". Simply add the additional options to the select list, add additional spans containing the textboxes, and in the script change the display of the span to block if the value of the select is "Toyota" or wahtever.

All the code given in this post has been tested and is intended to address the question asked.
Unless stated otherwise it is not just a demonstration.

Surely you can manage that yourself? Six options is not what I would call "many". Simply add the additional options to the select list, add additional spans containing the textboxes, and in the script change the display of the span to block if the value of the select is "Toyota" or wahtever.

I know I'm just saying. If I had 50 car brands, how would the layout be? Can you just like number them or something simple?

If you had 50 car brands there are several ways in which the code could be materially shortened/simplified. But I don't have the time to write code speculatively. One common outcome is that the OP says "Oh, but I have now thought of something else that I want".

I don't really understand your question about a button. If you are working with MySQL ask in the appropriate forum. But your questions suggest to me that you are trying to run before you can walk, and attempting something beyond your current coding capabilities. As this would seem to be a commercial application my advice would be the same as if my car was giving trouble - pay a professional to fix it.

All the code given in this post has been tested and is intended to address the question asked.
Unless stated otherwise it is not just a demonstration.