adding Javascript form to wordpress widget

Hello folks.
I'm trying to insert a small iframe as a widget.
It is a javascript search form.
The question is how to open the results in a new page.

It uses window.location = , but I cannot manage to change the script to use in stead.

The whole html page is this:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">
<html xmlns="">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>CFF widget</title>
<script type="text/javascript">
        window.onload = function(){
            var form = document.getElementById("form1");
            form.onsubmit = function(){
                var searchText = document.getElementById("searchText");
                window.location = "" + searchText.value;
                return false;
<style type="text/css">
 -webkit-box-shadow: 3px 3px 6px 2px #a9a9a9;
 -moz-box-shadow:3px 3px 6px 2px #a9a9a9;
 box-shadow:3px 3px 6px 2px #a9a9a9;



<div id="BoxShadowCodePreview" style="display: block; width: 180px; margin-left: 0%; border: 1px solid rgb(255, 255, 255); text-align: center; vertical-align: bottom; font-family: Arial, Helvetica, sans-serif; background-image: url(fondo_widget.jpg);" class="widget"> <form id="form1" method="post" action="">
      <p><img src="logo_widget.png" alt="xxxx" width="180" height="39" style="max-width:100%;height:auto;"></p>
      <p>Encuentra los oce como acceder a ellos.</p>
        <input type="text" id="searchText" name="searchText" />
        <input type="submit" value="Buscar" />
        <br />
<br />

I hope some javascript guru can help me.

Thanks a lot!