简体   繁体   English

HTML搜索选项,带有链接到外部网站的过滤器

[英]HTML search option with filters that link to external website

I'm required to use only HTML to create a web form in which the search result will link me to the external website's search results. 我只需要使用HTML即可创建一个Web表单,其中搜索结果会将我链接到外部网站的搜索结果。 There are search options with filters that I have included and when I enter the input and select the filters, it links me to the external website but it does not filter out the search from my own web form, meaning that it would treat any search as a normal search without the filters for 'month', '6months' and 'year' option. 我包含了带有过滤器的搜索选项,当我输入输入并选择过滤器时,它会将我链接到外部网站,但不会从我自己的Web表单中过滤掉搜索,这意味着它将把任何搜索视为常规搜索,没有用于“ month”,“ 6months”和“ year”选项的过滤器。

https://www.worldscientific.com/search/advanced - The website that I am supposed to link the search result from my web form to. https://www.worldscientific.com/search/advanced-我应该将搜索结果从我的Web表单链接到的网站。

HTML Code: HTML代码:

<html>
<style>
*{
   box-sizing: border-box;
 }

#border1 {
   width: 1000px;
   height: 500px;
   padding: 15px;
   border: 2px;
}

</style>

<h2>Part 3 - World Science</h2>
<form id="worldscience_search-form" 
  action="https://www.worldscientific.com/action/doSearch?field1=AllField&text1=text1&publication=&Ppub=&AfterMonth=&AfterYear=&BeforeMonth=&BeforeYear=&earlycite=on" method="get" target="_blank" class="jcf-select" autocomplete="off">
<div id="border1">
<div style = "float:left; width:20%">
  <select id="textArea2" name="field1" style = "height:40px; width:120px;">
  <option value="AllField">Anywhere</option>
  <option value="Title">Title</option>
  <option value="Contrib">Author</option>
  <option value="Keyword">Keywords</option>
  <option value="Abstract">Abstract</option>
  </select> 
  <br><br><br>

  <label for="publication">Published in</label> <br><br><br>

  <label>Publication Date</label>
  <input type="hidden" value="AfterYear">
  <input type="hidden" value="BeforeYear">
  <br>
  </div>

  <div style = "float:left; width:20%">
    <input type="text" placeholder="Enter Search term" name="text1" style = "width: 500px; height:40px"><br><br>
    <input type="text" name="publication" placeholder="e.g. Journal of Theoretical Biology" style = "width:500px; height :40px">
   <br><br><br>
  <input type="radio" name="Ppub" value="" checked="checked">
      <label>All dates</label>
      <br><br><br>
      <input type="radio" name="Ppub" value="">
      <label>Last</label>
      <br><br><br>
      <input type="radio" name="Ppub" value="">Custom Range
  </div>

  <div style = "float:left; width:50%">
  <br><br><br><br><br><br><br><br><br><br>
  <select id="Ppub" value="" style = "height:40px; width:120px;">
  <option value="">Select</option>
    <option value="20181218-20190118">month</option>
    <option value="20180718-20190118">6 months</option>
    <option value="20180118-20190118">year</option></select><br><br>

    <input type="submit" value="Search" />
    </div>
    </form>
    <br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>
    <br><br><br><br><br><br>
    </html>

I don't think that I should have coded the values in the option value. 我认为我不应该在选项值中编码值。 How am I supposed to filter out without coding in the dates? 我应该如何过滤掉而不对日期进行编码?

You have to use hidden inputs: (I only show start of the form) 您必须使用hidden输入:(我仅显示表单的开头)

<form id="worldscience_search-form" action="https://www.worldscientific.com/action/doSearch" method="get" target="_blank" class="jcf-select" autocomplete="off">
  <input type="hidden" name="field1" value="AllField">
  <input type="hidden" name="text1" value="text1">
  <input type="hidden" name="publication" value="">
  <input type="hidden" name="Ppub" value="">
  <input type="hidden" name="AfterMonth" value="">
  <input type="hidden" name="AfterYear" value="">
  <input type="hidden" name="BeforeMonth" value="">
  <input type="hidden" name="BeforeYear" value="">
  <input type="hidden" name="earlycite" value="on">

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM