Jump to content

CSS3 - modal inside a form


LOOKMAEWDAO

Recommended Posts

php/html/css3 :  I use a form to register for a show event. The button "Send" is at the bottom of the form.

I would like to use a modal from another button in the form for showing eventually the registration rules.

But that doesn't work. The modal opens and closes directly !

My question is thus :  is it possible to use a modal inside a form ?   Thanks.

Edited by LOOKMAEWDAO
Link to comment
Share on other sites

Yes! If its a static modal the button normally in the form would simply set the display on modal to display: block/flex instead of display: none.

If it has to dynamically load content, pressing the button it would need to preload content, then set to display: block/flex.

If the form does not submit by ajax, the form will reload the page causing the modal to its default state on page load.

Link to comment
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
×
×
  • Create New...