button function with ternary operator
<p>I  have the following code that is applied to a forward and next button. I also have the submit button that starts the process. It is desired that after you hit submit button (#lookup) it shows the forward and next to paginate through the results. The problem is that after the initial submit/#lookup and you hit forward and submit another search it shows the results from the second set/where you were on the first search after hitting next (IE starts at results 51-100 instead of back at 1). I need to modify the following</p>

<pre><code>function changestart(direction) 
{
var rowsElement  = $("#maxrows");
var rowsValue    = parseInt(rowsElement.val());
var startElement = $("#startID");
var value        = parseInt(startElement.val());
startElement.val(direction == "forward" ? value + rowsValue : direction == "back" ? value -
rowsValue : 1);
}
$("#previous").click(function(){changestart('back');});
$("#next").click(function(){changestart('forward');});
// not working
$("#lookup").click(function(){changestart('???');});
</code></pre>

<p>EDIT - the button currently has this inline JS</p>

<pre><code>&lt;input id="lookup" type="submit" name="lookup" value="Search" onclick="changestart('1')" /&gt;
</code></pre>

<p>How do I apply a click function to the submit button "#lookup" that starts the search back at 1?
thx</p>
