Welcome Guest, Not a member yet? Register   Sign In
How can I pass a value through a modal popup?

I'm trying to pass a value to a modal popup like this one...
but not sure how to go about passing a value to a Javascript modal popup like this.

I'm trying to stay away from another browser window popping up - id rather the user have to close the window before being able to go onto different parts of the application, which is why I want to use a javascipt modal.

Have you ever done anything like this? Can you give me some insight as to how to go about it? Thanks

What kind of value? Where's it coming from? Normally I'd put the value in the HTML, like an ID or data attribute, and then when the popup is supposed to open grab the value from the HTML. Or use ajax to retrieve the value...it really depends on where the value needs to come from, as well as the popup library. I use jQueryUI, so can't really help you with that particular modal you linked to.

I have a table populated by a foreach statement that pulls values from a database. What Id like to do is have a click-able link from this table of values that will open a popup modal of details based on the item you click on.

Is there a way to do something like this with jQueryUI?


Sure. You'd just use the 'open' event for the modal, grab the value from the HTML and insert it in the dialog or something.

Hard to tell exactly what you are trying to do without seeing code.

Theme © iAndrew 2016 - Forum software by © MyBB