Submitting a form via JavaScript to a new window with out form tags.

I need t be able to submit a form with a single text box to another site for purposed of searching without the benefit of any form tags.

Our website runs on DotNetNuke and that has total control over the forms tags on each page. Otherwise, I'd just set the target attribute and be done with it.  I've got the form running within the same browser window but really want it to go to another window - not sure if a new browser window a'la 'target="_blank" is a possibility or if is my only option.  I've seen lots of examples but everything relies on the form tag and that's something I don't have.  My feeble efforts either kill the form altogether or launch a window and kill the existing page. Any help would be greatly appreciated.

The code I'm using to submit the form is:


Open in new window

Many thanks in advance.
Who is Participating?
Kiran SonawaneProject LeadCommented:
Look at this below code
<meta http-equiv="Content-Language" content="en-gb">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>Kiran Test</title>
<script src="" type="text/javascript"></script>

     data = $("input, select, textarea").serialize();
     window.location = "" + data;


<input type="text" name="FistName" id="FistName" />
<input type="text" name="FistName" id="FistName" />
<input class="submit" id="submit" type="submit" value="Submit">



Open in new window

Would it be acceptable to send the form data using the GET method, or must it be send using the POST method?  
var param1 = encodeURIComponent( document.getElementById("field1_ID") );
var param2 = encodeURIComponent( document.getElementById("field2_ID") );
var paramN = encodeURIComponent( document.getElementById("fieldN_ID") );

location.href = "" + param1 + "&param2=" + param2 + "&paramN=" + paramN;


Open in new window

use $_GET (php), doGet(servlet), on the server side instead POST
saabStoryAuthor Commented:
Just what I needed.  I couldn't use anything with GET as I'm sending the values from my for to the website of another company.  No big deal - just looking up event locations based on a zip code.

Many thanks this will work just great!
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.