Announcement

Collapse
No announcement yet.

Search bar text does't disappear.

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

    Search bar text does't disappear.

    Hello,

    I am working on getting the text from the search bar to disappear when you click in to the search box, then reappear then click out.

    The current code is:

    Code:
    <form name="simplesearch" method="get" action="<actinic:variable name="OnlineScriptURL" value="Search Script URL" />">
    <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>
                <input type="hidden" name="page" value="search" />
             <input type="text" border="0" name="SS" size="10" value="SEARCH" onfocus="this.value='';" class="search-input" style="float:left; height:18px; border:none; border:0; font-size:10px;" />
             <input type="image" style="height:21px;" src="GO-button.png" name="ACTION" />
    			<input type="hidden" name="PR" value="-1" />
             <input type="hidden" name="TB" value="A" />
    
    </form>
    I have tried adding in some code to get the the word 'search' to disappear. After adding the code it worked, but lost use of the search box it self:

    Code:
    <input type="text" border="0" name="ss" size="10" value="SEARCH" onfocus="this.value='';" class="search-input" style="float:left; height:18px; border:none; border:0; font-size:10px;" onfocus="if (this.value=='SEARCH') this.value='';" onblur="if (this.value=='') this.value='SEARCH';"/>
    Hopefully you guys can help.

    Many thanks

    #2
    Welcome to the Community, Ian.

    You seem to have two onfocus bits and that won't work.

    When posting lumps of code, it's best to surround them between [ c o d e ] and [ / c o d e ] (type them without the spaces) as that makes it much more legible.

    Do that and someone will undoubtedly have another look.
    Norman - www.drillpine.biz
    Edinburgh, U K / Bitez, Turkey

    Comment


      #3
      Thanks

      Ah i did wonder why it didn't go in to a nice box, thanks

      Comment


        #4
        Code:
        <form name="simplesearch" method="get" action="<actinic:variable name="OnlineScriptURL" value="Search Script URL" />">
        
        <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>
        
                    <input type="hidden" name="page" value="search" />
        
                 <input type="text" border="0" name="SS" size="10" value="SEARCH" onfocus="this.value='';" class="search-input" style="float:left; height:18px; border:none; border:0; font-size:10px;" />
        
                 <input type="image" style="height:21px;" src="GO-button.png" name="ACTION" />
        
        			<input type="hidden" name="PR" value="-1" />
                 <input type="hidden" name="TB" value="A" />
        
        
        
        </form>

        Comment


          #5
          I have tried adding this to the site:

          Code:
          <input type="text" border="0" name="SS" size="10" value="SEARCH" class="search-input" style="float:left; height:18px; border:none; border:0; font-size:10px;" onfocus="if (this.value=='SEARCH') this.value='';" onblur="if (this.value=='') this.value='SEARCH';"/>
          still doesn't work, but if I change the 'SS'
          Code:
           name='SS'
          to 'search', then it works but I can't search the site.

          Comment


            #6
            You cannot change
            Code:
            name="SS"
            As this is the field that the internal search scripts are looking for the customer input in.

            When you say adding this, I presume you mean changing the existing line. If so it seemd that all you're doing is adding to an existing line:
            Code:
            onblur="if (this.value=='') this.value='SEARCH';"
            I can't see anything wrong with this.

            It may be worth uploading and pointing us to a faulty page.
            Norman - www.drillpine.biz
            Edinburgh, U K / Bitez, Turkey

            Comment


              #7
              The site is:
              www.livinghouse.co.uk

              as you can see in the top right corner, using the search box the text doesn't disappear.

              Have tried that code, most be something else interfering with it.

              Comment


                #8
                UPDATE:

                Assuming you're on SD 2013, then that may be the problem. There is code in SD 2013 that autopopulates the search bar with likely phrases, depending on the current customer input. This code is activated at page view time and is probably interfering with your proposed changes.

                If what you are doing works when in the Design mode, but not elsewhere, that would confirm it.
                Norman - www.drillpine.biz
                Edinburgh, U K / Bitez, Turkey

                Comment


                  #9
                  Ah ok, is there a way of turning that off or even changing it?

                  Yeah running SD 2013.

                  Comment


                    #10
                    I don't know how this is controlled. Perhaps someone else does.
                    Norman - www.drillpine.biz
                    Edinburgh, U K / Bitez, Turkey

                    Comment


                      #11
                      Woot! It turns out the some else is me! See http://community.sellerdeck.com/showthread.php?t=54952
                      Norman - www.drillpine.biz
                      Edinburgh, U K / Bitez, Turkey

                      Comment


                        #12
                        Thats Super, thanks.

                        Where do I find the actinicsearch.js?

                        I am new to the software and still getting my head round it.

                        Thanks again.

                        Comment


                          #13
                          Where do I find the actinicsearch.js?
                          Best not double-post - it annoys volunteers who find they've wasted their effort answering when you've already been helped elsewhere.
                          Norman - www.drillpine.biz
                          Edinburgh, U K / Bitez, Turkey

                          Comment

                          Working...
                          X