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

  • Home
  • SEARCH
  • 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 5958275
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T18:31:11+00:00 2026-05-22T18:31:11+00:00

I am working on contact page where the client can enter the postcode which

  • 0

I am working on contact page where the client can enter the postcode which will take them to google maps for directions to the company, the problem which i am having is although the hyperlink is set to target_blank but still the window opens on the back hand instead of opening in front of the website page. I have no idea why it opens on the back hand and focus is on the current page instead of moving it to google map page

  <a href="#" target="_blank">
               <img alt="" src="/images/contactUs/directionbtn.png" onclick="return openDirections(1);"  /></a>
<script type="text/javascript">

function openDirections(NumVal) {

    if (NumVal == 1) {

        if (document.getElementById("<%=txtPostcode.ClientID%>").value == "") {
            alert("PostCode can not be blank");
            document.getElementById("<%=txtPostcode.ClientID%>").focus();
            return false;
        }
        else {

            var regPostcode = /^([a-zA-Z]){1}([0-9][0-9]|[0-9]|[a-zA-Z][0-9][a-zA-Z]|[a-zA-Z][0-9][0-9]|[a-zA-Z][0-9]){1}([ ])([0-9][a-zA-z][a-zA-z]){1}$/;
            var tempURL = document.getElementById("<%=txtPostcode.ClientID%>").value;
            if (regPostcode.test(tempURL) == false) {
                alert("Please Enter a Valid PostCode");
                document.getElementById("<%=txtPostcode.ClientID%>").focus();
                return false;
            }
            else {
                var url = 'http://maps.google.co.uk/maps?saddr={' + $('#<%=txtPostcode.ClientID%>').val() + '}&daddr=&daddr=646+Preston+Rd,+Clayton-le-Woods,+Chorley+PR6+7EH,+United+Kingdom&iwloc=1&dq=Tangent+Design';


                document.location = url;
                return true;
            }
        }
    }
    </script>
  • 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-05-22T18:31:12+00:00Added an answer on May 22, 2026 at 6:31 pm

    Try window.open(url); instead of of document.location = url;

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have job insert page which is working fine. I just build an update
I'm working on an interactive contact search page (contacts are returned via ajax as
I am currently working on a page that will read in XML files that
See this page i'm currently working on. http://lacrosselaundry.com/lacrosseLaundry/contact.php If i change the font-size for
I'm working on a contact form for my church website. The church has an
I'm working profesionally on a php web application which contains contacts, among other data.
Working on a somewhat complex page for configuring customers at work. The setup is
Working with python interactively, it's sometimes necessary to display a result which is some
I have a working contact form in Joomla however when the user submits the
Ok I have our contact form fully working, and processing correctly. I have two

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.