This Javascript is not working on chrome....please help

<script type="text/javascript">
function jsFunction2()
  var myselect = refine2.options[refine2.selectedIndex].value;
  //window.location.href = 'view.php?refine2='+myselect;
	  document.getElementById("searchbox").style.display = "block";
	  window.location.href = 'view.php?refine2='+myselect;

 <select onChange="javascript: jsFunction2()" id="refine2" name="refine2">
              <option value="">---Select---</option>
<option selected="selected" value="1" >Today</option>
              		<option value="2">Yesterday</option>
                    <option value="3">This Week</option>
                    <option value="4">Last Week</option>
                    <option value="5">This Month</option>
                    <option value="6">Last Month</option>
                    <option value="7">Custom</option>
                    <option value="8">All</option>


I don’t see where the variable ‘refine2’ is defined.
Try defining it at the beginning of the function.

var refine2 = document.getElementById('refine2');

Gotta use that error console :wink: Don’t know how so many people forget it.


Here’s a brief tutorial.

Other than that, if the error persists, can you post a link to the page it is on?