Solved

Confusing code

Posted on 2012-03-19
5
273 Views
Last Modified: 2012-03-26
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 &amp; 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>

Open in new window

0
Comment
Question by:Zodka
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 83

Expert Comment

by:Dave Baldwin
ID: 37740202
Is it taking you to the 'advancedsearch.asp' page?
0
 

Author Comment

by:Zodka
ID: 37740297
No, it keeps taking me to a different search.asp.
0
 
LVL 83

Assisted Solution

by:Dave Baldwin
Dave Baldwin earned 500 total points
ID: 37740900
Then the javascript isn't being called and the 'search.asp' page would have to have all the search functions.  This doesn't, it is just a form to go to 'search.asp'.
0
 

Accepted Solution

by:
Zodka earned 0 total points
ID: 37747552
Ok, I figured it out, basically what happened was that the original javascript code on index.asp was interfering with the new search. Thanks for the help though.
0
 

Author Closing Comment

by:Zodka
ID: 37764938
Good response time, but I actually managed to figure out the problem. It was just because I didn't give full information.
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Make Float not to Wrap 15 66
Check if field exists SPUtility 5 48
Angular2 remove duplicates 11 24
Json and ajax javascript 24 23
This article describes how to create custom column layout styles for Bootstrap. The article uses 5 columns to illustrate the concept, but the principle can be extended to any number of columns.
Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
In this tutorial viewers will learn how to style elements, such a divs, with a "drop shadow" effect using the CSS box-shadow property Start with a normal styled element, such as a div.: In the element's style, type the box shadow property: "box-shad…
In this tutorial viewers will learn how to embed Flash content in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <object> tag to embed Flash content.: To specify that the object is Flash content, d…

734 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question