PDA

View Full Version : passing values to and from text boxes incompatible in IE



SK USA
01-26-2008, 02:26 AM
I have the code below on my site, it works in mozilla engine browsers like FireFox and Safari and Netscape but it does not work in IE.
The general search works fine. But the function of choosing a different value in the pulldown is suppose to send them to a different action form, but its not working in IE. Also "thisString" is suppose to remove a word if they enter, this as well works in FireFox but not IE


<html>
<head>
<script type="text/javascript">
<!--
function getSubmit(entry) {
var _form = document.searchKeyword;
var product_type = _form.SEARCH_PRODUCT_TYPE.value;
_form.prod.value = product_type;
var thisString;
thisString = document.searchKeyword.SEARCH_STRING.value;
thisString = thisString.replace(/carss/i, "");
document.searchKeyword.SEARCH_STRING.value = thisString;
if(product_type == 'ENGINE')
_form.action="/enginesearch";
else if(product_type == 'TRANNY')
_form.action="/transearch";
else
_form.action="/othersearch";

_form.submit();
}
//-->
</script>
<title>Search</title>
</head>
<body>
<form method="get" name="searchKeyword" action="/enginesearch">
<input type="hidden" name="prod" />
<table cellspacing="0">

<tr>
<td>
<input type="text" name="SEARCH_STRING" value="Enter Your Search Here" tabindex="1"/>
<input type="hidden" name="FILTER_INACTIVE_PRODUCTS" value="Y"/>
</td>
<td>
<select name="SEARCH_PRODUCT_TYPE" class="select-cats" tabindex="2">
<option value="ENGINE">In Engine
<option value="TRANNY">In Transmission
<option value="OTHER">In Others
</select>

</td>

<td>
<input type="submit" onclick='javascript:getSubmit(document.searchKeyword.SEARCH_STRING.value);' alt="Search" width="58" height="22" tabindex="3" />
</td>
</tr>
</table>
</form>
</body>
</html>

SK USA
01-27-2008, 05:40 PM
figured it out.

should've used the onSubmit within the <form> tag instead of onClick