S
S
Seva2012-04-17 21:11:11
JavaScript
Seva, 2012-04-17 21:11:11

Displaying external pages in a modal window?

Lord, good day.
The situation is as follows:
By pressing the button, a window with a form should open, the data from which is passed to the PHP script. Further, depending on the results of the script, another form should appear in the same window, and then another one, and so on several times.
I tried the most logical option - open it in a pop-up window, but firelis categorically refuses to work with them and opens the page with the form in a new tab.
I tried modal windows on jQuery - the page with the form is loaded, but after submit'a, the checking script is no longer opened in the window, but simply in the browser.
So far, I have only thought of pushing a frame into the modal window, but this solution seems somehow completely ugly to me. I would be grateful if someone could point me in the direction in which to dig.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
K
Konstantin Birzhakov, 2012-04-17
@Zewkin

I do similar functionality with jquery and the thickbox plugin . I also do validation on jquery + ajax and in case of an error I show this error directly in the modal window. If successful, I redirect to the desired php page. The plugin allows you to load and load data in one modal window, see the example at the link.

S
Stdit, 2012-04-18
@Stdit

I see two options here: either place the form in an iFrame inserted into the page “modally”, or in a regular modal popup (div), but block submit (return false) in the form, send and process the results with ajax. In the second case, the html of each form must either be loaded in advance or come from the XHR response.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question