|
  |
How To Add Default Text To Search Box |
|
|
|
|
Feb 16 2009, 09:48 AM
|
Group: Verified NS Member
Posts: 115
Joined: 11-February 08
Member No.: 644

|
Does anyone know how to add default text such as "Enter part number or keyword" to the site search box?
Thanks!
|
|
|
|
|
|
|
|
Feb 16 2009, 09:58 AM
|
Group: Verified NS Member
Posts: 100
Joined: 5-October 08
Member No.: 2,669

|
QUOTE (yoogimonster @ Feb 16 2009, 09:58 AM)  Does anyone know how to add default text such as "Enter part number or keyword" to the site search box?
Thanks! CODE <script type="text/javascript"> var el = document.getElementById("ctl00_ctl07_search"); el.value = "Search Here"; </script> Where ctl00_ctl07_search is the id of your search box, and Search Here is the text you want to show up there.
|
|
|
|
|
|
|
|
Feb 16 2009, 11:34 AM
|
Group: Verified NS Member
Posts: 115
Joined: 11-February 08
Member No.: 644

|
QUOTE (bendur @ Feb 16 2009, 07:08 AM)  CODE <script type="text/javascript"> var el = document.getElementById("ctl00_ctl07_search"); el.value = "Search Here"; </script> Where ctl00_ctl07_search is the id of your search box, and Search Here is the text you want to show up there. Thanks for your quick reply! I guess there's no way to have the text disappear on mouseclick like most websites? It's a pain to have to delete the text before typing in your search term. Also, do I just stick the code in my footer?
|
|
|
|
|
|
|
|
Feb 16 2009, 11:35 AM
|
Group: Verified NS Member
Posts: 32
Joined: 20-August 08
Member No.: 2,049

|
And another question, is there a way to make the text automatically disappear when you click in the box?
|
|
|
|
|
|
|
|
Feb 16 2009, 02:28 PM
|
Group: Verified NS Member
Posts: 100
Joined: 5-October 08
Member No.: 2,669

|
Y'all are needy aren't you? (IMG: http://forums.networksolutions.com/style_emoticons/default/wink.gif) CODE <script type="text/javascript"> var el = document.getElementById("ctl00_ctl07_search"); var helpText = "Search Here"; el.value = helpText; el.onfocus = function() {if (this.value == helpText) { el.value = "";}}; el.onblur = function() {if (this.value == "") { el.value = helpText;}} </script> Where ctl00_ctl07_search is the id of your search input box, and Search Here is the text you want to automatically appear. Oh, and your footer should work just fine. Be sure to turn off your wysiwyg editor before pasting the code in!
|
|
|
|
|
|
|
|
Feb 27 2009, 09:40 AM
|
Group: Verified NS Member
Posts: 10
Joined: 20-August 08
Member No.: 2,055

|
How can I use the code to populate both the email address field and product search? I've tried it several ways and the text in only 1 field will disappear, while the other stays there.
|
|
|
|
|
|
|
|
Feb 27 2009, 12:01 PM
|
Jedi Master
Group: Verified NS Member
Posts: 1,142
Joined: 10-August 07
From: Galaxy Far, Far Away...
Member No.: 13

|
You'd most likely have to paste the code twice, once with ctl00_ctl07_search and once with whatever your email field is. I'll admit I'm not sure on this one, but you can probably try it and see.
|
|
|
|
|
|
|
|
May 1 2009, 12:08 AM
|
Group: Verified NS Member
Posts: 54
Joined: 18-August 08
Member No.: 2,013

|
Great thread, should be sticky.
|
|
|
|
|
|
|
|
May 1 2009, 12:09 AM
|
QA
Group: Administrators
Posts: 1,751
Joined: 10-August 07
Member No.: 6

|
thread pinned
|
|
|
|
|
|
|
|
Aug 21 2009, 09:55 AM
|
Group: Verified NS Member
Posts: 42
Joined: 5-September 08
From: Dallas, Texas
Member No.: 2,298

|
Can I get some help with this, I followed all the instructions but its still not working. Please see code below.
<ns:search customtext="Search" type="custom" />
<script type="text/javascript"> var el = document.getElementById("ctl00_ctl03_ct100_search"); var helpText = "Product Search"; el.value = helpText; el.onfocus = function() {if (this.value == helpText) { el.value = "";}}; el.onblur = function() {if (this.value == "") { el.value = helpText;}} </script>
|
|
|
|
|
|
|
|
Aug 21 2009, 02:54 PM
|
Group: Verified NS Member
Posts: 666
Joined: 26-October 07
From: Syracuse NY
Member No.: 193

|
SOS which site are you trying this on? Depending on which site and where (left or right column) the search is, it will change the actual ID. So I just wanted to make sure first that you were the correct ID.
|
|
|
|
|
|
|
|
Aug 25 2009, 09:19 AM
|
Group: Verified NS Member
Posts: 42
Joined: 5-September 08
From: Dallas, Texas
Member No.: 2,298

|
Sorry its www.soslightbulbs.com I used firebug to get the column ID, I had this working previously and it just stopped!!! QUOTE (agkits @ Aug 21 2009, 02:54 PM)  SOS which site are you trying this on? Depending on which site and where (left or right column) the search is, it will change the actual ID. So I just wanted to make sure first that you were the correct ID.
|
|
|
|
|
|
|
|
Aug 25 2009, 10:10 AM
|
Group: Verified NS Member
Posts: 829
Joined: 15-January 08
From: Chicago, IL
Member No.: 501

|
Great Thread.
To change the style of the text...what would the code be (i.e. to make it italic)?
|
|
|
|
|
|
|
|
Sep 7 2009, 07:54 AM
|
Group: Verified NS Member
Posts: 10
Joined: 1-August 09
Member No.: 4,877

|
Having difficulty getting this to work. Right now have just an empty box with a go button - which is how I wanted it to look, only would like the customer to know what to do with the empty box! (IMG: http://forums.networksolutions.com/style_emoticons/default/smile.gif) note: I did not build left nav. using modules. I used one column of custom html and insterted ns: code. code I used for search function: <ns:search type="default" /> Not sure why the java script won't work for "search here" TIA!
|
|
|
|
|
|
|
|
Sep 7 2009, 02:23 PM
|
Group: Verified NS Member
Posts: 204
Joined: 24-October 08
From: Pittsburgh, PA
Member No.: 2,842

|
QUOTE (EKop @ Sep 7 2009, 08:54 AM)  Having difficulty getting this to work. Right now have just an empty box with a go button - which is how I wanted it to look, only would like the customer to know what to do with the empty box! (IMG: http://forums.networksolutions.com/style_emoticons/default/smile.gif) note: I did not build left nav. using modules. I used one column of custom html and insterted ns: code. code I used for search function: <ns:search type="default" /> Not sure why the java script won't work for "search here" TIA! Design/Site Design/Columns/Left side columns, Search Site-click the pencil to edit, the Module Name is Search SIte, which can be edited, and in the text/html box at Header Text you can add text there. Hope this helps.
|
|
|
|
|
|
|
|
Sep 7 2009, 04:03 PM
|
Group: Verified NS Member
Posts: 10
Joined: 1-August 09
Member No.: 4,877

|
QUOTE (lynn44 @ Sep 7 2009, 02:23 PM)  Design/Site Design/Columns/Left side columns, Search Site-click the pencil to edit, the Module Name is Search SIte, which can be edited, and in the text/html box at Header Text you can add text there. Hope this helps. Yes, I understand how to edit this area I built the html that goes in there, I couldn't figure out why this code would not work for my site. Seems it's part of the CSS that we do not have access to. Thanks for trying to help!
|
|
|
|
|
|
|
  |
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:
|