When button is submitted it should POP-up message

I try to make button event. When it is submitted it should pop-up message (bootstrap). Which JavaScript is the best possible to do this event?

Code for the button:

<button type="submit" name="myform" class="" >Send</button>

Hi @toplisek, did you have a look at the bootstrap docs?

Just note that with a type="submit" button, you can’t use the data attribute API; you have to open the modal programmatically so that you can also prevent the default event. Otherwise the form would get submitted and the modal would only open very briefly, if at all.

Is there good practice Javascript to use SUBMIT as type due to independence from Bootstrap?

No, just use type="submit" if the button is supposed to submit a form (similar to <input type="submit">); otherwise (i.e. when merely triggering JS actions like opening a popup) use type="button".

Thank you for the message. I will test.

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.