Announcement

Collapse
No announcement yet.

Direct Product Search

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

    Direct Product Search

    I have introduced a search facility that takes customers straight to a product if they enter the code but it doesn't find the product unless the capitalisation matches and most if not all of my product codes are in capitals. Does anyone have a fix for this please? I'm sure it's simple bit of code I need somewhere ! Here is the script I use:

    <FORM METHOD="POST" ACTION="http:/cgi-bin/ss000002.pl">
    <td valign=middle noWrap align=left width="10%">
    <INPUT TYPE="HIDDEN" NAME="NOLOGIN" VALUE="1">
    <INPUT TYPE="text" NAME="PRODREF" SIZE="15" value="Product Code"
    onFocus="this.value='';this.style.background='#FFFFFF'">
    </td>
    <td valign=bottom noWrap align=left>
    <input type="image" border="0" name="ACTION" src="quicksearch.gif"
    alt="Product Code Search (case sensitive)">
    </td>
    <input TYPE=HIDDEN NAME="PR" VALUE="-1">
    <input TYPE=HIDDEN NAME="TB" VALUE="A">
    <input TYPE=HIDDEN NAME="SHOP" VALUE="NETQUOTEVAR:SHOPID">
    <!--<INPUT TYPE="submit" VALUE="Lookup">-->
    </td>
    </tr>
    </FORM>
    Richard
    www.worldofenvelopes.com

    #2
    An easy fix (if all your codes are indeed capitalised) is to force all user input to uppercase. Change

    <INPUT TYPE="text" NAME="PRODREF" SIZE="15" value="Product Code"
    onFocus="this.value='';this.style.background='#FFFFFF'">

    to

    <INPUT TYPE="text" NAME="PRODREF" SIZE="15" value="Product Code"
    onFocus="this.value='';this.style.background='#FFFFFF'" onblur="this.value=this.value.toUpperCase()">
    www.gbradley.co.uk
    Web Development, Actinic Patches, Scripts & more

    Comment


      #3
      Thanks for your very quick response Kermy ... I tried what you said by using copy/paste and then upoaded but it still doesn't work for some reason. All my products are capitalised as far as I know but in any case if I try product code ab10 it doesn't work still whereas if I put in AB10 it does.

      Am I doing anything wrong or do you have any other remedies?

      Thanks
      Richard
      www.worldofenvelopes.com

      Comment


        #4
        Hi Richard,

        It worked when clicking the submit button but not when hitting enter. Try this instead:

        <INPUT TYPE="text" NAME="PRODREF" SIZE="15" value="Product Code" onFocus="this.value='';this.style.background='#FFFFFF'" onkeyup="this.value=this.value.toUpperCase()">
        www.gbradley.co.uk
        Web Development, Actinic Patches, Scripts & more

        Comment


          #5
          That's fantastic thanks !!
          Richard
          www.worldofenvelopes.com

          Comment

          Working...
          X