Skip to content

How can I pass a parameter when I toggle modal using JavaScript #34316

Answered by GeoSot
FoundAdd asked this question in Q&A
Discussion options

You must be logged in to vote

you can try $('#record-modal').modal('toggle', my-source-element)

I think it works for now, but I wouldn't suggest it.
Instead I would suggest you to use Modal.getOrCreateInstance('#record-modal').toggle(my-source-element)

PS: getOrCreateInstance method will be available in 5.0.2(will be released soon)

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@FoundAdd
Comment options

Answer selected by FoundAdd
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants