Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. Web Development
  3. purpose of <code>function reload(form)</code>

purpose of <code>function reload(form)</code>

Scheduled Pinned Locked Moved Web Development
questionphp
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • N Offline
    N Offline
    nahelna
    wrote on last edited by
    #1

    function reload(form)
    {
    var val=form.cat.options[form.cat.options.selectedIndex].value;
    self.location='postquery.php?cat=' + val ;
    }

    am really new to this i want to know how it functions -which form does it refer to? -what is cat?(an object of?) -options? infact evrthing thanx

    P 1 Reply Last reply
    0
    • N nahelna

      function reload(form)
      {
      var val=form.cat.options[form.cat.options.selectedIndex].value;
      self.location='postquery.php?cat=' + val ;
      }

      am really new to this i want to know how it functions -which form does it refer to? -what is cat?(an object of?) -options? infact evrthing thanx

      P Offline
      P Offline
      Perspx
      wrote on last edited by
      #2

      Hi, The porpose of this is script is to get the value of a select box and then go to a page based on this selection. For form.cat.options[form.cat.options.selectedIndex].value: form is a form that is called "form" and "cat" is a select box. What this line does is get the value of the selected option in this select box, which is what form.cat.options.selectedIndex is for - the []s show that form.cat.options is an array. This value is stored in a variable called "val". What the next line does redirect the current browser window to "postquery.php" with the argument "cat" being the val variable that was assigned in the first line. For example, if "val" was "data", then the browser window would be redirected to "postquery.php?cat=data". Hope this helps, --Perspx

      "The Blue Screen of Death, also known as The Blue Screen of Doom, the "Blue Screen of Fun", "Phatul Exception: The WRECKening" and "Windows Vista", is a multi award-winning game first developed in 1995 by Microsoft" - Uncyclopedia

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups