Solved

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

Posted on 2003-10-30
3
5,179 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Scrolling the scrollbar in a list in html 9 49
Text in block not displaying properly 2 33
[HTML] Graphic not centered on page 4 46
Centered Image 2 23
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.
Not sure what the best email signature size is? Are you worried about email signature image size? Follow this best practice guide.
In this tutorial viewers will learn how to embed an audio file in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: : The declaration should display (CODE) HTML5 is supported by the most recent versions of all major browsers…
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)

895 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

15 Experts available now in Live!

Get 1:1 Help Now