Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8037825
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T03:02:25+00:00 2026-06-05T03:02:25+00:00

I am trying to open a webpage on a new window buy building a

  • 0

I am trying to open a webpage on a new window buy building a URL based off of a users input. The issue im running into is that it will open a new window, but will not use the generated URL. It will open an about:blank window instead.

I put the code in JSFIDDLE, and it actually works there, but I can’t figure out why its not working on my page. But JSFIDDLE actually leaves the original page saying [Object], which I can’t figure out either.

Any help is appreciated.

http://jsfiddle.net/cmirab/SHFgw/2/

HTML:

 <form id="search" name="Safe">
    <h1>How Safe</h1>
    <h2>is your Neighborhood?</h2>
    <p class="p1">Enter your zip to find crime statistics in your area:</p>
    <input type="text" name="search">
    <input type="hidden" name="url" id="url">
    <a class="button1" href="javascript:window.open(document.Safe.url.value)">Search</a>
    </form>

JQuery
var partFields = $(‘#search’).val(‘#search’).not(‘#url’);

$(partFields).change(function() {
var urlB = 'http://classic.crimereports.com/map?';
var urlE = '&searchButton.x=0&searchButton.y=0';
var urlValue = urlB + partFields.serialize() + urlE;

$('#url').val(urlValue); // set the hidden input value
});

CSS:

 #search {background:#232426;padding:5px 0 21px 24px;color:#737985;margin:0 0 30px;line height:15px;}
    #search h1 {font-size:71px;line-height:1.2em;color:#ffad01;letter-spacing:-4px;}
    #search h2 {font-size:35px;letter-spacing:-1px;margin:0 0 10px;}
    #search input {border:none;background:#37383a;padding:9px 10px;margin:0 4px 0 0;width:240px;}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T03:02:27+00:00Added an answer on June 5, 2026 at 3:02 am

    Try this instead, I modified some of your js and markup as well.
    JSFiddle

    var $searchbox = $('#search input[name="search"]')
        $searchbox.change(function() {
        var urlB = 'http://classic.crimereports.com/map?';
        var urlE = '&searchButton.x=0&searchButton.y=0';
        var urlValue = urlB + $searchbox.serialize() + urlE;
    
        $('.button1').attr('href',urlValue); // set the hidden input value
    });​
    
    
    <form id="search" name="Safe" >
                        <h1>How Safe</h1>
                        <h2>is your Neighborhood?</h2>
                        <p class="p1">Enter your zip to find crime statistics in your area:</p>
                        <input type="text" name="search">
                        <input type="hidden" name="url" id="url">
                        <a class="button1" href="javascript:window.open(document.Safe.url.value)" target="_blank">Search</a>
                    </form>​
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying open a new window using url.Action. And the new Window url
I'm trying to open multiple URL's input streams, here's my current code FileInputStream fi
I trying to open C: directly with FileStream without success: new FileStream(C:, FileMode.Open, FileAccess.Read,
I'm trying to open a file for input in Excel with this line :
I'm trying to write a Windows command file to open a webpage in IE,
here is my code SqlCommand insert_user = new SqlCommand(insert into dbo.users (username,password,firstname,lastname,address,country,city,phonenumber,gender,email) VALUES ('
First off I'm new to Android and Java.. I have been trying to add
im quite new to php and javascript but still trying to get my webpage
I'm trying to load a local web page executing: var html = document.open('google.html'); document.documentElement.innerHTML
I am trying open a very large file in Emacs and it fails to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.