Home>

Sorry for being unfamiliar with the first use, thank you.

We customize the search program that can process HTML.
Specifically, the HTML for displaying the file search program Everything is customized.

Everything
http://www.voidtools.com/support/everything/
Japanese help
https://sites.google.com/site/everythingjphelp/http

I am processing the form part and adding search option information to the URL.
Do you carry the contents of check boxes and select boxes with HTML + Javascrypt? take over? Reproduce?
I want to do that, but I can't. . .

Thank you.

Error message
Press the search button to move to the next page.
I will return to the original.
Applicable source code
<! DOCTYPE HTML PUBLIC "-// W3C // DTD HTML 4.01 Transitional // EN" "http://www.w3.org/TR/html4/loose .dtd ">
<head>
<meta http-equiv = "Content-Type" content = "text/html;charset = utf-8">
<meta name = "viewport" content = "width = 512">
<title>Files Search</title>
<link rel = "stylesheet" href = "/ ress.css" type = "text/css">
<link rel = "stylesheet" href = "/ main.css" type = "text/css">
<link rel = "shortcut icon" href = "/ favicon.ico" type = "image/x-icon">
<script src = "/ jquery.min.js" type = "text/javascript">
</script>
<script src = "/ scripts.js" type = "text/javascript">
</script>
</head>
<body>
~ Explanation ~
<center>
  <div>
    <form name = "sf" action = "/" method = "get">
      <input name = "search" type = "text" title = "Search Everything" value = "">
      <input type = "submit" value = "search" />
      <br>
      <input type = "checkbox" name = "path" value = "1" checked = "checked">
      <select name = "count">
        <option value = "30">30</option>
        <option value = "50">50</option>
        <option value = "100">100 cases</option>
        <option value = "500">500 cases</option>
      </select>
      <br>
    </form>
  </div>
~ Result display ~
</center>
</body>
// Check box selection return
$(function () {
    get_data = "";
    // 4 is the same name choice = number of checkboxes, form name = sf, checkbox name = path
    for (i = 0;i<4;i ++) {
        if (document.sf.path [i] .checked) {
            if (get_data! = "") {get_data + = "/";}
            get_data + = document.sf.path [i] .value;
        }
    }
    document.sf.path [num] .checked =! (document.sf.path [num] .checked);
}
// Select box selection return
$(function () {
    document.sf.count [num] .selected = true;
}
  • Answer # 1

    If you set yourself as the form destination, it will only have parameters, so if you retrieve the GET parameter withURL ()orURL.searchParamsWell then.

    Re: Hillbook

  • Answer # 2

    Send it again from the initial load state, so if you want to keep it, use a server-side language session or localStorage?

  • Answer # 3

    There is also the idea of ​​using ajax as a SPA

  • Answer # 4

    Thanks to you now.
    The default for the select box is no longer reflected, but it follows.

    Thank you very much!

    // ◆ Definition
    // 2. Get parameters from URL and reflect in HTML
    var params = (new URL (document.location)). searchParams;
    var path = Boolean (params.get ("path"));
    var count = parseInt (params.get ("count"));
    // ------------------------------------------------ ----------------------
    // ◆ Conducted when reading
    $(function () {
    // 2. Get parameters and reflect in HTML
      // Return check box selection
      document.sf.path.checked = !! (path);
      // Select box selection return
      document.sf.count.value = count;
    });