|Join Nairaland / LOGIN! / Trending / Recent / New|
Stats: 2,445,565 members, 5,507,539 topics. Date: Friday, 03 April 2020 at 12:47 PM
Sir easy how do I make a drop down selection button to collect it's option field from an I'd created and also an amount field to automatically bring up the price of the selected field then multiply it by it quantity?
rushman003:Ok, i will modify this reply when i get hold of my PC ( later in the night). But before then, i understand your 1st question, you want to create a drop down menu and make use of whatever the user selects using an ID tag... Good.
But your second question, if you can try to reframe it. I will check back and type out the code later... Sorry, i hardly go out with my other PC...
i tried using php but then i realised php wasn't included in my heading. anyway, use this and lemme know the result for the 1st question.
var dropdownmenu = document.getElementById('dropmenu') ;
var selectedmenu = dropdownmenu.options[dropdownmenu.selectedIndex].text;
From here you can do whatever you want to do with your value(selectedmenu)
<select name="dropdown" id="dropmenu">
<option value="2">Another thing</option>
<option value="3">this other thing</option>
<input type="button" name="submit" value="get input" onclick="drop();"/>
i went through your second question again and i figured something. if thats what you really want.
you can create a jquery event function that when an item is selected , an array function runs to check with the selected item and its corresponding price is shown.
Yea! Thanks for the second answer exactly what I needed. Have not completed my jquery tutorial Ni. To the first one, I have an empty drop down menu what I want is that if user add something. Eg a user add class room now in school management system and you wanna register the student under that class. You it will be different menu like add class and add student. So when you wanna add a student to the class automatically the class you added should become an option under class for the student and if you add another class it will b automatically added to the drop down again. Thanks
I saw your reply the very day you posted it but my head was hot then, i could not read through it... But now i have tried to get through your reply but for real i couldnt quite get you... Maybe you can share your code and i will try to see IF i can debug it or may you just tell me want you want to do or expect. You are welcome
|Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health |
religion celebs tv-movies music-radio literature webmasters programming techmarket
Nairaland - Copyright © 2005 - 2020 Oluwaseun Osewa. All rights reserved. See How To Advertise. 44