django-bootstrap-modal-forms icon indicating copy to clipboard operation
django-bootstrap-modal-forms copied to clipboard

Add custom javascript code in modal forms

Open devkapilbansal opened this issue 4 years ago • 2 comments
trafficstars

Rather than a question or a bug report, it would be a suggestion that can be helpful for the users.

Although modal forms look good but I want to add my custom javascript code that is not possible. Like if I want to pass some value from the base page to the popup after is get loads.

I have to make change in forms.js file to make it happen.

But it would be good if these can be customised too easily.

Correct me if I am wrong. Thanks

devkapilbansal avatar Dec 03 '20 18:12 devkapilbansal

@devkapilbansal Can you please accurately define your use case and other possible use cases for your proposed functionality?

trco avatar Mar 21 '21 10:03 trco

@trco recently I was building an e-commerce project where it was needed. I had some information of the user on my main page and what I want was to fill my form with that information. I want these forms to have an additional area for extra code that can be triggered after form is loaded successfully.

devkapilbansal avatar Mar 21 '21 19:03 devkapilbansal

Custom JS code can be added to the modals as described in this issue https://github.com/trco/django-bootstrap-modal-forms/issues/158. This information will be added to the docs.

trco avatar Sep 02 '23 18:09 trco