Jump to content
  • 0

Pass parameters to a Bootstrap modal window


VincenzoCocciolo

Question

Hi everyone

I made some experiment but didn't fine a way to show a Bootstrap modal windows with some parameters from the calling page passed.

No problem in showing the modal window (except for the responsivness but I'll address later)

 

 

But any parameter passed to the URL in the HTML Block of the calling page is not received.

Is there a best practice on this?

On the other end is there a way to use Session parameter or a more Javascript method ?

Regards

 

image.thumb.png.1e08e710456696048f897e6b33cf6e45.png

 

 

Link to comment
Share on other sites

5 answers to this question

Recommended Posts

  • 0

Just saw this in passing; there's a neat little Bootstrap trick that might be able to do this for you.  Under this section:

https://getbootstrap.com/docs/5.0/components/modal/#varying-modal-content

Note how the 'data-bs-whatever' becomes the ID (or [@field:ID] for example].  If you replace that with the data source ID in your datapage, then use the javascript they recommend there to carry the "recipient" over to the modal, you can potentially carry that single parameter over.  How to pass others might require an extension of the script they provided.  Let me know if this makes sense.   

Link to comment
Share on other sites

  • 0

Hi! Just an update - if you have a modal that is showing behind the Results Page, you can use this code in the Header:

<style>

.modal {
 z-index: 9999 !important;
}

</style>

In addition, if you would like to automatically adjust the size of the modal based on its content. You can use this code in the Header as well:

<style>

body .modal-dialog { /* Width */
max-width: 50%;
width: auto !important;
}

</style>

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...