TheMightyEddy Posted June 24, 2012 Share Posted June 24, 2012 Hello everyone, how would I make something like if a user picks a different option from the drop down menu, each input box will be different. Example: <option value="" selected="Select A Car"></option> <option value="audi">Audi</option> </span><input name="audi" type="text" id="audi" size="30" placeholder="Audi R8" class="required"> BUT if for example the user DOES NOT pick "Audi" and they pick BMW, the input will be like this: <option value="bmw">BMW</option> </span><input name="bmw" type="text" id="bmw" size="30" placeholder="BMW M5" class="required"> So each option will show a different input box. How do I do this? Quote Link to comment https://forums.phpfreaks.com/topic/264708-drop-down-menu-input-boxes/ Share on other sites More sharing options...
Barand Posted June 24, 2012 Share Posted June 24, 2012 Put the input box inside a <span> or a < div> and use javascript to set the innerHTML property in response to an onchange event. Quote Link to comment https://forums.phpfreaks.com/topic/264708-drop-down-menu-input-boxes/#findComment-1356696 Share on other sites More sharing options...
TheMightyEddy Posted June 24, 2012 Author Share Posted June 24, 2012 Put the input box inside a <span> or a < div> and use javascript to set the innerHTML property in response to an onchange event. Shoot, man sorry i'm noob. how would i do? Quote Link to comment https://forums.phpfreaks.com/topic/264708-drop-down-menu-input-boxes/#findComment-1356698 Share on other sites More sharing options...
Barand Posted June 24, 2012 Share Posted June 24, 2012 I assume those were just isolated extracts - what does your form really look like? Quote Link to comment https://forums.phpfreaks.com/topic/264708-drop-down-menu-input-boxes/#findComment-1356702 Share on other sites More sharing options...
TheMightyEddy Posted June 25, 2012 Author Share Posted June 25, 2012 Here is what it suppose to look like: http://i.imgur.com/yp8OY.png Quote Link to comment https://forums.phpfreaks.com/topic/264708-drop-down-menu-input-boxes/#findComment-1356711 Share on other sites More sharing options...
Barand Posted June 25, 2012 Share Posted June 25, 2012 do you have a database of makes and associated models? Quote Link to comment https://forums.phpfreaks.com/topic/264708-drop-down-menu-input-boxes/#findComment-1356772 Share on other sites More sharing options...
Barand Posted June 25, 2012 Share Posted June 25, 2012 PS As there is only a single input box, why don't you name it "model" and just change the placeholder text Quote Link to comment https://forums.phpfreaks.com/topic/264708-drop-down-menu-input-boxes/#findComment-1356796 Share on other sites More sharing options...
TheMightyEddy Posted June 25, 2012 Author Share Posted June 25, 2012 PS As there is only a single input box, why don't you name it "model" and just change the placeholder text See the thing is I still need the name and ID of each input box. Quote Link to comment https://forums.phpfreaks.com/topic/264708-drop-down-menu-input-boxes/#findComment-1356823 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.