Announcement

Collapse
No announcement yet.

Search Results | Coding Error!?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Search Results | Coding Error!?

    I've been adressing the coding errors on our site and have managed to get it down to just one now. It's within our search results page. I've attached the error as an image as it's abit of a long one! lol.

    This is also the code i am using for our search results page:


    HTML Code:
    <form method="get" action="<actinic:variable name="OnlineScriptURL" value="Search Script URL" />">
    <input type="hidden" name="RANDOM" value="<actinic:variable name='Random'/>" />
    
    <actinic:block if="%3cactinic%3avariable%20name%3d%22IsHostMode%22%20%2f%3e">
       <!-- Hidden field when in trial mode -->
       <input type="hidden" name="SHOP" value="<Actinic:Variable Name="HiddenFields"/>" />
    </actinic:block>
    
    <table border="0" cellpadding="0" width="<actinic:variable name="ACTSTDWIDTH" />" align="center">
       <tr>
          <td>
             <b><Actinic:Variable Name="SearchResultSummary"/></b><br />
             <Actinic:Variable Name="SearchResultContinue"/>
          </td>
       </tr>
       <tr>
          <td>
             <actinic:variable name="SearchResultsList" />
          </td>
       </tr>
       <tr>
          <td>
             <b><Actinic:Variable Name="SearchResultSummary"/></b><br />
             <Actinic:Variable Name="SearchResultContinue"/>
          </td>
        </tr>
    </table>
    
    <hr size="1" />
    
    <input type="hidden" name="PAGE" value="SEARCH" />
    
    <table border="0" cellspacing="0" cellpadding="0" width="<actinic:variable name="ACTSTDWIDTH" />" >
       <tr>
          <td colspan="2" valign="top">
             <Actinic:Variable Name="SearchPrompt"/> <Actinic:Variable Name="RetailOnlyWarning"/>
             <br /><br />
          </td>
       </tr>
       <tr>
          <td valign="top" align="center">
             <table border="0" cellspacing="0" cellpadding="3">
                <tr>
                   <td valign="top">
                      <b><Actinic:Variable Name="SearchString"/></b><br />
                      <input type="text" name="SS" size="40" />
                      <br />
                      <Actinic:Variable Name="SearchCombine"/>
                      <input type="radio" name="TB" checked="checked" value="A" />
                      <Actinic:Variable Name="SearchAndPrompt"/>
                      <input type="radio" name="TB" value="O" />
                      <Actinic:Variable Name="SearchOrPrompt"/>&nbsp;<Actinic:Variable Name="SearchCombineText2"/>
                      <script language="javascript" type="text/javascript">
                      <!--
                         for (nIndex = 0; nIndex < document.forms.length; nIndex++)
                          {
                           if (document.forms[nIndex] && document.forms[nIndex].SS)
                             {
                             document.forms[nIndex].SS.focus();
                             }
                          }
                      // -->
                      </script>
                   </td>
                  <td valign="top">
                      <actinic:block if="%3cactinic%3avariable%20name%3d%22PriceSearchIsAllowed%22%20%2f%3e">    
                        <b><Actinic:Variable Name="SearchPriceRangeLabel"/></b>
                        <br />
                        <actinic:variable name="SearchPriceBandList" />
                     </actinic:block>
                  </td>
                </tr>
                <actinic:variable name="SearchablePropertyList" />
                <actinic:block if="%3cactinic%3avariable%20name%3d%22IsSearchablePropertiesCombinedWithAnd%22%20%2f%3e" />
                   <input type="hidden" name="GB" value="A" />
                </actinic:block>
                <actinic:block if="%3cactinic%3avariable%20name%3d%22IsSearchablePropertiesCombinedWithOr%22%20%2f%3e" />
                   <input type="hidden" name="GB" value="O" />
                </actinic:block>
                <actinic:block if="%3cactinic%3avariable%20name%3d%22SearchBySectionsUsed%22%20%2f%3e" />
                   <tr>
                      <td colspan="2" valign="bottom"> <b><Actinic:Variable Name="SearchControlLabel"/></b><br />
                         <select name="SX">
    								<actinic:block if="%3cactinic%3avariable%20name%3d%22SetupSearchAllSections%22%20%2f%3e%20%3d%3d%20False">
    									<option value="0"> </option>
    								</actinic:block>
                            <actinic:variable name="SearchSectionList" />
                         </select>
                     </td>
                  </tr>
               </actinic:block>
               <tr>
                  <td colspan="2"valign="bottom">
                     <input type="submit" name="ACTION" value="<Actinic:Variable Name="SearchLabel"/>" />
                  </td>
               </tr>
            </table>
          </td>
       </tr>
    </table>
             <!-- alert("<Actinic:Variable Name="UnregCustomersNotAllowedMessage"/>");
             return false; -->
    
    </form>
    So if you have any ideas as to finxing this error please let me know. Then i can finally upload without Actinic prompting me!

    Cheers FrAz
    Attached Files
    Cheers FrAz

    #2
    In the above layout, look for the line


    document.forms[nIndex].SS.focus();

    Change it to

    // document.forms[nIndex].SS.focus();


    If the error goes away, we've located the problem line.

    Report what you see.
    Norman - www.drillpine.biz
    Edinburgh, U K / Bitez, Turkey

    Comment


      #3
      Nice one Norman, that seems to have shut Actinic up for the time being. I'l forward my findings onto Actinic.

      Thanks again. FrAz
      Cheers FrAz

      Comment


        #4
        O.K. That shut up the error message but stops the focus being automatically set on the search field. Lets try to fix that. In the layout in your post #1, try moving the block
        Code:
                          <script language="javascript" type="text/javascript">
                          <!--
                             for (nIndex = 0; nIndex < document.forms.length; nIndex++)
                              {
                               if (document.forms[nIndex] && document.forms[nIndex].SS)
                                 {
                                 document.forms[nIndex].SS.focus();
                                 }
                              }
                          // -->
                          </script>
        to the very bottom (after the </form> tag).
        Norman - www.drillpine.biz
        Edinburgh, U K / Bitez, Turkey

        Comment


          #5
          Another qeustion leading on from my previous post:

          I have no coding errors on the our search results page, but before we were getting coding errors about 'Nested HTML form tags' and breifly looking through the forum they best thing to do was restore factor settings on that layout, which is what we did.

          Everything works fine, but i've notice that when you search throught the site the thumbnail image don't align properly depending on the description length. This never happened with our old search result layout code, but the factory setting seems to have missed out some code to align the image correctly

          our old code was (with nested HTML form tags):
          HTML Code:
          <form method="get" action="<actinic:variable name="OnlineScriptURL" value="Search Script URL" />">
          <input type="hidden" name="RANDOM" value="NETQUOTEVAR:RANDOM" />
          
          <actinic:block if="%3cactinic%3avariable%20name%3d%22IsHostMode%22%20%2f%3e">
             <!-- Hidden field when in trial mode -->
             <input type="hidden" name="SHOP" value="<Actinic:Variable Name="HiddenFields"/>" />
          </actinic:block>
          <!-- V7 Results HTML begin -->
          <!-- Add Results Page header HTML here -->
          
          
          <TABLE BORDER=0 CELLSPACING=0 CELLPADDING=5 WIDTH="754" ALIGN="CENTER">
          	<TR>
          		<TD colspan=<actinic:variable name="SEARCHCOLS"/> ALIGN=LEFT>
          		  <B><actinic:variable name="SearchResultSummary"/></B><BR><actinic:variable name="SearchResultContinue"/>
          		</TD>
          	</TR>
          	<TR>
          	    <Actinic:SEARCH_RESULTS>
          		<TD valign=top width=<actinic:variable name="SEARCHCOLWIDTH"/> ALIGN=LEFT>
          		  <!--<actinic:variable name="SearchResultItem"/>.-->
          		  <Actinic:XMLTEMPLATE NAME="ImageLine">
          <Actinic:Variable Name="SearchResultLink"/><img src="<actinic:variable name="SearchResultProductImage" />" <actinic:variable name="SearchResultProductImageSize" /> border=0 /></a>
          		  </Actinic:XMLTEMPLATE>
          <BR>
          	<actinic:variable name="SearchResultLink"/><B><actinic:block if="%3cactinic%3avariable%20name%3d%22SearchResultShowsName%22%20%2f%3e">
          	<center><Actinic:Variable Name="SearchResultProductName"/></center>
          </actinic:block></B></A> <actinic:block if="%3cactinic%3avariable%20name%3d%22SearchResultShowsSectionName%22%20%2f%3e">
          	<Actinic:Variable Name="SearchResultSectionName"/>
          </actinic:block><actinic:block if="%3cactinic%3avariable%20name%3d%22SearchResultShowsPrice%22%20%2f%3e">
          	<center><B><Actinic:Variable Name="SearchResultPrice"/></B></center>
          </actinic:block> <BR>
          		  <actinic:block if="%3cactinic%3avariable%20name%3d%22SearchResultShowsDescription%22%20%2f%3e">
          	<br /><actinic:variable name="SearchResultFullDescription" />
          </actinic:block><BR>
          		  <actinic:block if="%3cactinic%3avariable%20name%3d%22SearchResultShowsProperties%22%20%2f%3e" >
          	<br /><actinic:variable name="SearchResultProp" />
          </actinic:block><P>
          		</TD>
                      <Actinic:S_TABLEEND/>
            	    </Actinic:SEARCH_RESULTS>
          	</TR>
          	<TR>
          		<TD colspan=<actinic:variable name="SEARCHCOLS"/> ALIGN=LEFT>
          		  <B><actinic:variable name="SearchResultSummary"/></B><BR><actinic:variable name="SearchResultContinue"/>
          		</TD>
          	</TR>
          </TABLE>
          <HR SIZE="1" ALIGN="CENTER" WIDTH="CUSTOMVAR:ACTSTDWIDTH">
          <actinic:variable name="MainArea" value="Search Page Bulk Area"/>
          
          <!-- Add Results Page footer HTML here -->
          <!-- V7 Results HTML end -->
          
          </form>
          And our new factory setting layout code is:

          HTML Code:
          <form method="get" action="<actinic:variable name="OnlineScriptURL" value="Search Script URL" />">
          <input type="hidden" name="RANDOM" value="<actinic:variable name='Random'/>" />
          
          <actinic:block if="%3cactinic%3avariable%20name%3d%22IsHostMode%22%20%2f%3e">
             <!-- Hidden field when in trial mode -->
             <input type="hidden" name="SHOP" value="<Actinic:Variable Name="HiddenFields"/>" />
          </actinic:block>
          
          <table border="0" cellpadding="0" width="<actinic:variable name="ACTSTDWIDTH" />" align="center">
             <tr>
                <td>
                   <b><Actinic:Variable Name="SearchResultSummary"/></b><br />
                   <Actinic:Variable Name="SearchResultContinue"/>
                </td>
             </tr>
             <tr>
                <td>
                   <actinic:variable name="SearchResultsList" />
                </td>
             </tr>
             <tr>
                <td>
                   <b><Actinic:Variable Name="SearchResultSummary"/></b><br />
                   <Actinic:Variable Name="SearchResultContinue"/>
                </td>
              </tr>
          </table>
          
          <hr size="1" />
          
          <input type="hidden" name="PAGE" value="SEARCH" />
          
          <table border="0" cellspacing="0" cellpadding="0" width="<actinic:variable name="ACTSTDWIDTH" />" >
             <tr>
                <td colspan="2" valign="top">
                   <Actinic:Variable Name="SearchPrompt"/> <Actinic:Variable Name="RetailOnlyWarning"/>
                   <br /><br />
                </td>
             </tr>
             <tr>
                <td valign="top" align="center">
                   <table border="0" cellspacing="0" cellpadding="3">
                      <tr>
                         <td valign="top">
                            <b><Actinic:Variable Name="SearchString"/></b><br />
                            <input type="text" name="SS" size="40" />
                            <br />
                            <Actinic:Variable Name="SearchCombine"/>
                            <input type="radio" name="TB" checked="checked" value="A" />
                            <Actinic:Variable Name="SearchAndPrompt"/>
                            <input type="radio" name="TB" value="O" />
                            <Actinic:Variable Name="SearchOrPrompt"/>&nbsp;<Actinic:Variable Name="SearchCombineText2"/>
                            <script language="javascript" type="text/javascript">
                            <!--
                               for (nIndex = 0; nIndex < document.forms.length; nIndex++)
                                {
                                 if (document.forms[nIndex] && document.forms[nIndex].SS)
                                   {
                                   document.forms[nIndex].SS.focus();
                                   }
                                }
                            // -->
                            </script>
                         </td>
                        <td valign="top">
                            <actinic:block if="%3cactinic%3avariable%20name%3d%22PriceSearchIsAllowed%22%20%2f%3e">    
                              <b><Actinic:Variable Name="SearchPriceRangeLabel"/></b>
                              <br />
                              <actinic:variable name="SearchPriceBandList" />
                           </actinic:block>
                        </td>
                      </tr>
                      <actinic:variable name="SearchablePropertyList" />
                      <actinic:block if="%3cactinic%3avariable%20name%3d%22IsSearchablePropertiesCombinedWithAnd%22%20%2f%3e" />
                         <input type="hidden" name="GB" value="A" />
                      </actinic:block>
                      <actinic:block if="%3cactinic%3avariable%20name%3d%22IsSearchablePropertiesCombinedWithOr%22%20%2f%3e" />
                         <input type="hidden" name="GB" value="O" />
                      </actinic:block>
                      <actinic:block if="%3cactinic%3avariable%20name%3d%22SearchBySectionsUsed%22%20%2f%3e" />
                         <tr>
                            <td colspan="2" valign="bottom"> <b><Actinic:Variable Name="SearchControlLabel"/></b><br />
                               <select name="SX">
          								<actinic:block if="%3cactinic%3avariable%20name%3d%22SetupSearchAllSections%22%20%2f%3e%20%3d%3d%20False">
          									<option value="0"> </option>
          								</actinic:block>
                                  <actinic:variable name="SearchSectionList" />
                               </select>
                           </td>
                        </tr>
                     </actinic:block>
                     <tr>
                        <td colspan="2"valign="bottom">
                           <input type="submit" name="ACTION" value="<Actinic:Variable Name="SearchLabel"/>" />
                        </td>
                     </tr>
                  </table>
                </td>
             </tr>
          </table>
                   <!-- alert("<Actinic:Variable Name="UnregCustomersNotAllowedMessage"/>");
                   return false; -->
          
          </form>
          Again it's something i've just picked up on so am non the wiser at locating the suttle differences between the two, but if someone can point me in the right direction it'll be much appreciated.

          Cheers ...oh & nt nt! lol
          Cheers FrAz

          Comment

          Working...
          X