Solved

FORM submit in the same window and <BASE Target="_blank">

Posted on 2003-10-30
3
5,176 Views
Last Modified: 2012-05-04
I have a webpage with lots of links which should open in new windows. I add <BASE Target="_blank"> to avoid inserting  Target="_blank"  in each "<A HREF" tag. But now a search :
   <form action="cgi-bin/search.pl" method="GET">
      <input type="text">
      <INPUT TYPE="submit" value="Search">
   </form>
will also open in a new window. How can I avoid that a new window opens if I click on this submit button?

Thank you, Ben
0
Comment
Question by:bengore
3 Comments
 
LVL 28

Accepted Solution

by:
sybe earned 220 total points
ID: 9648695
add target="_self" to the form-tag

<form action="cgi-bin/search.pl" method="GET" target="_self">
0
 
LVL 14

Assisted Solution

by:Renante Entera
Renante Entera earned 30 total points
ID: 9648709
Hello there!

I had an advice for you.  You better disable your submit button once it is click to avoid multiple submit to happen.

So instead of this line :

    <form action="cgi-bin/search.pl" method="GET"> and <input type="submit" value="Search">

Replace it with :

    <form name="form1" action="cgi-bin/search.pl" method="GET" OnSubmit="return DisableSubmit();">
    and
    <input type="submit" name="Search" value="Search">

Then here is the javascript function for DisableSubmit() :
<script>
  function DisableSubmit()
  {
    document.form1.Search.disabled = true;
    return true;
  }
</script>

Goodluck !
eNTRANCE2002 :-)
0
 

Author Comment

by:bengore
ID: 9648866
Thank you for your help (and the advice)!
Ben
0

Featured Post

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Deprecated and Headed for the Dustbin By now, you have probably heard that some PHP features, while convenient, can also cause PHP security problems.  This article discusses one of those, called register_globals.  It is a thing you do not want.  …
Building a website can seem like a daunting task to the uninitiated but it really only requires knowledge of two basic languages: HTML and CSS.
In this tutorial viewers will learn how to position overlapping items using z-index in CSS. They will also learn the restrictions on the z-index property.  Create a new HTML document with an internal stylesheet.: Create a div in CSS and name it Red.…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

746 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now