0

An Internet site has URL like www.manyresultpages.net/cgi-bin/search.cgi?recnum=7777&

Can I make my Dad a local static html page (for his PC) with one input field and a submit button, that will modify the above URL, replace "7777" with the input text and open the new URL in a new tab on button click?

I'm HTML-challenged, googled for 45 mins without getting far. Did learn jsfiddle.net is down. Can load jQuery if that would help.

Paul
  • 245
  • 3
  • 14

1 Answers1

2

Yes. Use method="get" in the form to place the form data in the URL, use an input field with name="recnum" to get the right name for the form data, and use target="_blank" in the form to open the page in a new window/tab:

<form method="get" target="_blank">
  <input type="text" name="recnum"/>
  <input type="submit"/>
</form>

Note that you can't control whether the page is opened in a new window or a new tab, as that is a user preference in the browser.

Guffa
  • 687,336
  • 108
  • 737
  • 1,005
  • Looks wonderful! But where does the static part of the URL go? I've revised the question to clarify that it's not my site--I only control the local page I'm hoping to use to link to it. – Paul Jul 13 '12 at 00:24
  • You can use an `url` attribute in the `form` tag, but the default is to use the same URL as the current page. – Guffa Jul 13 '12 at 08:50