• Resolved labihi

    (@labihi)


    Hi,

    Taking the example below :

    <form method="post" id="dataForm" action="show.php" target="_blank">
    ...
    
    <input type="submit" name="action" value="Generate" class="generateBTN"/>
    </form>

    In this example of html code, when I click on generate button I have a new window showing some content from show.php file.

    My request is : is there any possiblity to generate this result in popup (using your plugin) instead of open a new window ?

    Thank you in advance.

    https://www.ads-software.com/plugins/easy-fancybox/

Viewing 8 replies - 1 through 8 (of 8 total)
  • Yes you can but you need to make the form live on a stand-alone html page outside of your WordPress pages.

    1. Create a html file (for example dataform.html) with proper HTML (do you know how to do that?) and put your form in the body.
    2. Upload it to your site root.
    3. Then test the form by accessing the file location directly in your browser.
    4. If it works (showing the buttons from show.php after submitting) then go back to your WordPress page and create a (text or button) link to the form location and give it a class="fancybox-iframe".
    5. Go to Settings > Media and enable the iFrame option if you had not done that before.

    Now, the link will open a lightbox in iframe mode showing the form. Submitting the form should be possible within that iframe…

    Thread Starter labihi

    (@labihi)

    Thank you for your feed-back.

    I don’t understand why should I put the form html in a separate file !?

    Thread Starter labihi

    (@labihi)

    And if it is possible, please, explain more how can I create this html file and make a reference to it in the parent file.

    If you put the form in a normal WordPress page, and then link to it to open in a lightbox in iframe mode, the lightbox will show not only the form but also the normal site header, sidebar(s) and footer…

    There is a basic example of how to create such a stand-alone file on https://www.w3schools.com/html/html_editors.asp … just two differences:
    1. do not call the file index.htm but something like dataform.htm
    2. replace the lines in that example:

    <h1>My First Heading</h1>
    <p>My first paragraph.</p>

    with your form code.

    Then use your FTP program (or the web filemanager of your hosting provider) to upload that file to the same location as where the file show.php lives.

    Then open that form file (now online) in your browser to test it.

    Thread Starter labihi

    (@labihi)

    Actually, the content that will be shown is from the PHP file not the html file.

    The HTML file contains just a form that the clients fill and then based on informations from HTML file, the PHP file send the final result.

    Actually, the content that will be shown is from the PHP file not the html file.

    That’s not a problem if the PHP file returns the results in HTML format.

    Thread Starter labihi

    (@labihi)

    In this case how can I show the result in popup using this plugin ?

    please note that I have that php File in the website root folder.

    In this case how can I show the result in popup using this plugin ?

    In iframe mode. See my first answer.

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘showing content in popup instead of new window [PHP]’ is closed to new replies.