rizwansyed Posted August 17, 2018 Share Posted August 17, 2018 Hi I have two options like option1 and option2 from a drop down list. When i select option1,it shows option1A and option1B When i select option2,it shows option2A and option2B. Its like either of one selection.After selecting, how can i submit the form. where to call the submit button , so that both my selected values gets submitted. Attached is the file Thanks and Regards Rizwan Syed submit form.txt Link to comment Share on other sites More sharing options...
dsonesuk Posted August 17, 2018 Share Posted August 17, 2018 (edited) ??? Where you usually place a submit button, at the bottom within the opening/closing form elements? You can place all those within a single form with submit at bottom then prevent the hidden dropdown submitting anything, even if an option was selected prior to be hidden by adding disable attribute to hidden select element itself. ALSO you can't have identical id references on the same page, it will always work with the first encountered and ignore the rest. Edited August 17, 2018 by dsonesuk Link to comment Share on other sites More sharing options...
rizwansyed Posted August 17, 2018 Author Share Posted August 17, 2018 (edited) Hi Dsonesuk Thanks for the reply. I can able to submit by keeping a single form. with some modifications, i can able to hide the disabled element from submitting. Thanks and Regards Rizwan Syed submit form1.txt Edited August 17, 2018 by rizwansyed Link to comment Share on other sites More sharing options...
dsonesuk Posted August 17, 2018 Share Posted August 17, 2018 As mentioned multiple identical ID NOT! ALLOWED! it will only work on 1 single dropdown, also i see no code indicating you are disabling the dropdowns, hiding yes! disabling NO! https://www.w3schools.com/tags/att_disabled.asp Link to comment Share on other sites More sharing options...
rizwansyed Posted August 17, 2018 Author Share Posted August 17, 2018 Hi Dsonesuk Now it works fine.Now only issue here am facing is that using two divs "option1" and "select option1" appears top and bottom (as shown in attached image) Instead I require it side by side with a small gap. I tried using <br> <div>, it does not work Link to comment Share on other sites More sharing options...
dsonesuk Posted August 17, 2018 Share Posted August 17, 2018 Then you need read the tutorial and understand how block elements (div, p) work differently from inline elements (span, strong) and make appropriate adjustments to counteract there default actions as I'm not going to spoon feed you. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now