Zodka
asked on
Confusing code
I'm having trouble figuring out some code that's being used for a search function on my site. The original designer of it (who I can't contact) claimed that you could use this search and it would search for every variable used in the item. It doesn't work. So hopefully someone here can help me decipher this code. I should also mention that I need to move the search function to another part of the site.
<div class="PageTitle">
<%=TR("Search")%>
</div>
<div id="NavSearch">
<table cellpadding="0" cellspacing="0" border="0">
<tr><td>
<script type="text/javascript">
function partSearch() {
var radio = document.getElementsByName("searchtype");
var x = document.nickform.searchtxt.value;
if(radio[0].checked == true){
window.location = 'advancedsearch.asp?search=1&catid=0&SearchStr=&AllAnyExact=all&Region1=&Region2=&Region3=&Region4=&customs_criteria=1&cfs_txt_P='+x+'&cfs_txt_W=&PriceRangeCurrency=USD&PriceFrom=&PriceTo=&StartFrom=&StartTo=&EndFrom=&EndTo=&ExcludeStr=&OrderBy=end_asc&MaxResults=10&sbmtAdvSearch=Go#results';
return false;
}
if(radio[1].checked == true){
window.location = 'advancedsearch.asp?search=1&catid=0&SearchStr='+x+'&AllAnyExact=all&chkTitleAndDesc=on&Region1=&Region2=&Region3=&Region4=&customs_criteria=1&cfs_txt_P=&cfs_txt_W=&cfs_txt_make=&cfs_txt_model=&cfs_txt_sh_weight=&cfs_txt_sh_dimensions=&PriceRangeCurrency=USD&PriceFrom=&PriceTo=&StartFrom=&StartTo=&EndFrom=&EndTo=&ExcludeStr=&OrderBy=end_asc&MaxResults=10&sbmtAdvSearch=Go#results';
return false;
}
}
</script>
<form action="search.asp" method="post" name="nickform">
<input type="text" name="searchtxt" class="search_input" />
<input class="button" type="submit" value="<%=TR("Go")%>" id="search" name="search" onClick="return partSearch();" /><br />-->
<!--<input type="radio" name="searchtype" checked="checked" /><%=TR("Part Number")%><br />
<input type="radio" name="searchtype" /><%=TR("Title & Description")%><br />-->
<%
if not SIMPLE_SEARCH_TITLE_ONLY then
%>
<input type="radio" id="searchtype_0" name="searchtype" value="0" /><%=TR("Title & Description")%><br />
<%
else
%>
<!--<input type="radio" id="searchtype_0" name="searchtype" value="0" /><%=TR("Listing Title")%><br />-->
<%
end if ' bTitleSearchOnly then
%>
<!--<input type="radio" id="searchtype_1" name="searchtype" value="1"/><%=TR("Listing #")%><br />-->
<!-- <input type="radio" id="searchtype_2" name="searchtype" value="2" /><%=TR("User")%><p />
<input class="button" type="submit" name="adv_srch" value="<%=TR("Advanced Search")%>" />
</form>
</td></tr>
</table>
Is it taking you to the 'advancedsearch.asp' page?
ASKER
No, it keeps taking me to a different search.asp.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Good response time, but I actually managed to figure out the problem. It was just because I didn't give full information.