ProductCart E-Commerce Solutions Homepage
Forum Home Forum Home > ProductCart > Customizing ProductCart
  New Posts New Posts RSS Feed - Search Box with Initial Value
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Search Box with Initial Value

 Post Reply Post Reply
Author
Message
loracady View Drop Down
Newbie
Newbie
Avatar

Joined: 28-December-2007
Location: United States
Status: Offline
Points: 2
Post Options Post Options   Thanks (0) Thanks(0)   Quote loracady Quote  Post ReplyReply Direct Link To This Post Topic: Search Box with Initial Value
    Posted: 01-December-2009 at 11:44am
I want to have a small search box that has "search keyword or item #" as the initial value.  When a user clicks inside the search box, the initial value is automatically removed and the user can enter a keyword search term or item #.  Has anyone done this? 
www.TheSleepShop.com
Back to Top
Greg Dinger View Drop Down
Certified ProductCart Developers
Certified ProductCart Developers
Avatar

Joined: 23-September-2006
Location: United States
Status: Offline
Points: 238
Post Options Post Options   Thanks (0) Thanks(0)   Quote Greg Dinger Quote  Post ReplyReply Direct Link To This Post Posted: 01-December-2009 at 11:54am
Lora - do a view source on http://www.madcowcutlery.com/ have a look at the search box.  tehre is a tiny bit of JS in there.
Back to Top
netprofits View Drop Down
Certified ProductCart Developers
Certified ProductCart Developers


Joined: 05-January-2006
Location: United States
Status: Offline
Points: 22
Post Options Post Options   Thanks (0) Thanks(0)   Quote netprofits Quote  Post ReplyReply Direct Link To This Post Posted: 01-December-2009 at 11:56am
Hi loracady, yes, we've done that for several of our clients' sites. See http://www.orchestratedhome.com/shop/pc/home.asp as an example.
 
Use something like this for the INPUT field:
<input type="Text" name="keyword" size="18" value="Search..." onfocus="if(this.value=='Search...')this.value='';" >
 
value="" should have the initial value you want displayed.
The onfocus section says that when a visitor clicks on the box, if the value = "Search..." then clear the value. You will need to change the this.value=='Search...' to match the initial value you enter in the value parameter.
 
Does that help?
NetProfits Internet Consulting

Certified ProductCart Developer

Our Site
Back to Top
katharina View Drop Down
Senior Member
Senior Member
Avatar

Joined: 25-October-2005
Location: United States
Status: Offline
Points: 0
Post Options Post Options   Thanks (0) Thanks(0)   Quote katharina Quote  Post ReplyReply Direct Link To This Post Posted: 01-December-2009 at 11:57am
This works with 3.51.
You need to add this to the header.asp or footer.asp depending on where you want it to show.

<!-- Start Search Box -->
<!-- #Include file="SmallSearchBox.asp"-->
<!-- End Search Box -->

Next you open SmallSearchBox.asp in the pc folder and edit it a tiny bit. 
Find the line:
<input type="Text" name="keyword" size="23" value="" id="smallsearchbox" >
and replace with:
<input type="Text" name="keyword" size="23" value="Keyword or Item#" id="smallsearchbox" >

You see I added the Keyword or Item#, but you can change that part to what ever you want.  Do not loose the quotes on either end.  This is just html editing, so no programing needed.

You can see the result at www.germanplaza.com 

Katharina
*******************
www.GermanPlaza.com
*******************
Back to Top
loracady View Drop Down
Newbie
Newbie
Avatar

Joined: 28-December-2007
Location: United States
Status: Offline
Points: 2
Post Options Post Options   Thanks (0) Thanks(0)   Quote loracady Quote  Post ReplyReply Direct Link To This Post Posted: 01-December-2009 at 12:08pm
Thanks, guys!  You are a bunch of smarties!
www.TheSleepShop.com
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.031 seconds.