Faqts : Business : Programming : Shopping For You : JavaScript : Forms

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

311 of 372 people (84%) answered Yes
Recently 8 of 10 people (80%) answered Yes

Entry

How to submit a FORM to a new window with certain features set?

Dec 3rd, 2009 10:42
Fasee Uddin, Shopping Snooper, forum net tr, Martin Honnen, http://www.buystonesonline.com


You can submit a FORM to a new window with
              <FORM TARGET="_blank" ...>
            but that newly opened window has the standard dimensions and
features. 
            If you want to set the features of the window then use the
onsubmit 
            handler to open a window with a certain name and the desired
features 
            first, then set the FORM's TARGET to the window name before
submitting 
            the FORM:

            <SCRIPT>
            function openTarget (form, features, windowName) {
              if (!windowName)
                windowName = 'formTarget'   (new Date().getTime());
              form.target = windowName;
              open ('', windowName, features);
            }
            </SCRIPT>


            <FORM ACTION="whatever"
                  ONSUBMIT="openTarget
            (this, 'width=300,height=300,resizable=1,scrollbars=1');
return true;"
            >

            The openTarget function needs at least two arguments,
without the third 
            it always opens a new window (like target _blank) but you
can provide a 
            third argument for the window name to reuse the window later.


http://www.nighthawks.co.in
http://www.contactindianhotels.com
http://www.buygranites.com
http://www.buystonesonline.com
http://www.mahimawholesalejewelry.com
http://www.jaipurbandhej.com
http://www.celestialindia.net
http://www.kareemhandicrafts.com
http://www.websitesofhotels.com
http://www.goodtimepass.com
http://www.heritagehotelsinrajasthan.com
http://www.silverwholesalejewellery.com
http://www.indianmedicaltourism.com