Jump to content
rizwansyed

submit form for this code

Recommended Posts

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

Share this post


Link to post
Share on other sites

??? 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 by dsonesuk

Share this post


Link to post
Share on other sites

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 by rizwansyed

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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

submit_image.PNG

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now

×