Home PHP JavaScript CSS WordPress APIs .htaccess Other How-To Useful Scripts What I Recommend
Posted on by Aleksandar Gichevski ()
Like it? Share:

Warning: Missing argument 1 for BaseDD::BaseDD(), called in /home/agicheco/public_html/wp-content/plugins/digg-digg/include/dd-manual.php on line 123 and defined in /home/agicheco/public_html/wp-content/plugins/digg-digg/include/dd-class.php on line 97

Warning: Missing argument 2 for BaseDD::BaseDD(), called in /home/agicheco/public_html/wp-content/plugins/digg-digg/include/dd-manual.php on line 123 and defined in /home/agicheco/public_html/wp-content/plugins/digg-digg/include/dd-class.php on line 97

Warning: Missing argument 3 for BaseDD::BaseDD(), called in /home/agicheco/public_html/wp-content/plugins/digg-digg/include/dd-manual.php on line 123 and defined in /home/agicheco/public_html/wp-content/plugins/digg-digg/include/dd-class.php on line 97

Warning: Missing argument 4 for BaseDD::BaseDD(), called in /home/agicheco/public_html/wp-content/plugins/digg-digg/include/dd-manual.php on line 123 and defined in /home/agicheco/public_html/wp-content/plugins/digg-digg/include/dd-class.php on line 97
 

Sometimes when using popup window on the website it is useful to submit a form using javascript and parse the information.

JavaScript popup form is easy and clean way how this can be done. Using attribute ‘target’ there is an option to assign event that is executed when form is submitted and all data from the form is parsed to the new popup window.

On destination file in our example (popup.php) you get the information as every normal form is submitted.

Below is example of code that does submit form into popup.

Code

<form action="http://agichevski.com/popup.php" method="post" target="DoSubmit" onsubmit="DoSubmit = window.open('about:blank','DoSubmit','width=400,height=350');">
<input type="text" name="field" id="field" >
<input type="submit" name="submit" value="Submit this form in popup window">
</form>

See it in action

Here it is real example so you can see this in action.






Other Posts You Might Like


2 responses to “Submit form into popup window using javascript”

  1. Muskie says:

    What does popup.php do to acces the field, use the id?

    • agiche says:

      Hi Muskie,

      It uses the ‘name’ attribute… in the example above — name=”field”–

      Just write in popup.php
      echo $_POST[‘field’];

Leave a Reply

Your email address will not be published. Required fields are marked *

Get a fast, free website audit

Enter your URL below to get full in-depth SEO report and tips.

‚Äč

Useful Scripts

Most Popular Posts

Recent Posts

June 14th, 2014
Website Optimization Using Gzip Compression

June 10th, 2014
Google Search AutoComplete API

May 14th, 2014
What is a Tag Cloud and How to Calculate it by Formula

March 27th, 2014
Error writing file /tmp (errcode 28) Solved!

February 15th, 2014
Fixed CSS & HTML Navigation Bar

February 9th, 2014
Benchmark Your Server (CPU, File IO, MySQL) with SysBench

February 8th, 2014
JavaScript Array Basics

January 29th, 2014
JVZoo IPN API in PHP

January 25th, 2014
Payoneer Debit Card for Freelancers to receive money online

January 24th, 2014
How HTML Color Codes are generated?

Read Latest Posts directly on Facebook

Archive

X

Get a fast, free website audit

Enter your URL below to get full in-depth SEO report and tips.