I have the following code:
I want to do special things in Javascirpt function(displa yrow) only if the value of submit button (searchbutton) equals to "search". ( Basically only if this button had been pressed)
right now every time I go to the form, the stuff in the javascirpt is happening but I want them to be place only if the search button had been pressed!
do you know how?
Code:
<script type="text/javascript"> function displayRow(){ var ET = document.getElementById("ExpenseTable"); var row3 = document.getElementById("searchbutton"); If row3.value == 'search' { if (row2.value == 'Expenses') { ET.style.display = ''; } } </script> <input type="submit" name="searchbutton" id="searchbutton" value='search' border="0" onClick="displayrow();return false;">
right now every time I go to the form, the stuff in the javascirpt is happening but I want them to be place only if the search button had been pressed!
do you know how?
Comment