www.webdeveloper.com
Results 1 to 2 of 2

Thread: Opening links through search box

  1. #1
    Join Date
    Jul 2012
    Posts
    7

    Opening links through search box

    Bit of a noob to web development. I'm trying to get to certain websites by entering "their" identifiers into a search box. For some reason a blank page opens along with the website.

    I want the website to open in the same, current window.

    Any comments/advice related to this type of processes or doing would be more than greatly appreciated!!! HERE IS THE CODE: (problem lies between "search box" comment)


    Code:
    <html>
    	<title>SMK | Welcome</title>
    	<head>
    	<link rel="stylesheet" type="text/css" href="css/content.css">
    	<link rel="stylesheet" type="text/css" href="css/main.css">
    	
    </head>
    	
    <body>
    		<h1>
    			Shift My Knob | Welcome
    		</h1>
    
    		<div class="img-searchBox">
    			<img src="images/searchBox.png">
    		</div> 
    
    		<div class="img-mainBar">
    			<img src="images/mainBar.png">	
    		</div> 
    <!--SEARCH BOX_______________________________________________________________________-->
    		<script type="text/javascript">
    
    	var carType = "";
    	if (carType = "ferrari") {
    		carType = "http://ferrari.com";
    }
    	else if (carType = "honda") {
    		carType = "http://honda.com";	
    }
    
    function goTo() {
    
    	search = window.open(carType)
    	window.open()
    	return false;
    }
    
    		</script>
    <form action="" method="get" onsubmit="return goTo()">
    	<label for="url">		
    	<input id="search" type="text" name="search" value="search" size="30" onFocus="this.value=''">
    	</label>
    <!--________________________________________________________________________________-->
    
    	
    		<ul id="topnav">
    			<li id="topnav-1"><a href="sport.html" title="Sport">Sport</a></li>
    			<li id="topnav-2"><a href="tuner.html" title="Tuner">Tuner</a></li>
    			<li id="topnav-3"><a href="muscle.html" title="Muscle">Muscle</a></li>
    			<!--<li id="topnav-4"><a href="home.html" title="Home">Home</a></li>-->
    		</ul>
    </body>
    </html>
    Last edited by ecarter202; 10-14-2012 at 01:25 AM.

  2. #2
    Join Date
    Oct 2012
    Posts
    1

    resolved Java script

    Is my java script enabled. Can someone else enable it for me please.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles