Lightbox in a form


Topic: Lightbox in a form

jouvrard pro asked 1 months ago

Hello,

I have a form where I can upload an image, and change it after.When I go in a previously created item I can see my image and I would like to have a lightbox when I click on it.It works... partially. :)

When I click on the image it opens like a charm, but when I close it by clicking on the top right cross, it posts my form, as if I had clicked on the "save" button.

You can find an example with my snippet, it's created with your original code, I just changed the "div.row" for "form.row".

  • Click on an image
  • Close it by clicking on the top right cross
  • After few seconds, you'll see the problem... :)

https://mdbootstrap.com/snippets/jquery/furax/1083662

Thank for your help.

Jerome


Adam Jakubowski staff answered 1 months ago

Hi,

Lightbox is not created to build it in the forms and that this type of functionality was not provided, so if you want to use it this way, you must ensure that forms are not sent by using Java Script.

Best,

Adam


jouvrard pro answered 1 months ago

Ok I understand but it's a little problem for me. :) I'll find an other solution.

Thanks!

Jerome


Please insert min. 20 characters.
Status

Answered

Specification of the issue
  • User: Pro
  • Premium support: No
  • Technology: jQuery
  • MDB Version: 4.8.8
  • Device: All
  • Browser: All
  • OS: All
  • Provided sample code: No
  • Provided link: Yes
Tags