I got a problem with Jquery, I’m making a dynamic form on RoR, so I have a button next to an input that call to an jQuery modal. There the user would do a lookup and select some information from a list.
The problem is that I need to insert back the information in the input next to the button that the user click. So i was wondering there’s any way to store the button dom and then reuse it so set the value on the input when the modal is getting hidden? Or there’s other ways to solve this?
Function called on click over the button.
function openPicker(event)
{
$('#myModal').modal('toggle')
}
Function called when the modal it’s getting hidden.
$('#myModal').on('hidden', function () {
})
Any help will be appreciated!
Assuming you want to store what triggered the openPicker function, you can store the reference to the event in data and read it when needed.