Overclock.net › Forums › Software, Programming and Coding › Coding and Programming › Web Coding › Creating a pop-up for a search form
New Posts  All Forums:Forum Nav:

Creating a pop-up for a search form

post #1 of 3
Thread Starter 
I have a value in my search box that'll when clicked in, will make the text in that search bar dissappear..
Code:
<input type="text" name="keyword" size="15" value="Keyword Search..." onFocus="this.value = '';" />
When someone clicks on the search button, I want a pop-up to come up saying "Please enter keyword(s)" if they forget to click in the search box, where the "Keyword Search" text is, to prevent from displaying the term "keyword Search" in their search results

An example of this is on BestBuy's home page.. bestbuy.ca

this is their code for that, but I dont know which java script to put in my header..
Code:
<INPUT SIZE="22" class="Body-Form" VALUE="Keyword Search" NAME="keyword" maxlength="100" onFocus="emptySearch(this);" onChange="javascript:while(''+this.value.charAt(0)==' ')this.value=this.value.substring(1,this.value.length);">
post #2 of 3
take a look at THIS PAGE hope that helps
My 2013 System
(13 items)
 
  
CPUMotherboardGraphicsRAM
AMD FX-6 6100 Black Edition 6 Core 3.3Ghz Socke... Gigabyte 970A-DS3 Sapphire HD 7850 OC Edition 2GB Dual DVI HDMI D... Crucial 4GB (2x2GB) DDR3 1600Mhz Ballistix Tact... 
Hard DriveOSMonitorKeyboard
WD 1TB 3.5" SATA-III Caviar Green Internal Hard... Windows 7 Ultimate 32bit Philips E-line 247E4LHSB LED LCD 23.6" HDMI Mon... Logitech 
PowerCaseMouseMouse Pad
Antec 520W High Current Gamer PSU CiT Vantage Midi Mesh Gaming Case with HD Audio... Logitech MX518 volkswagen golf gti30 
  hide details  
Reply
My 2013 System
(13 items)
 
  
CPUMotherboardGraphicsRAM
AMD FX-6 6100 Black Edition 6 Core 3.3Ghz Socke... Gigabyte 970A-DS3 Sapphire HD 7850 OC Edition 2GB Dual DVI HDMI D... Crucial 4GB (2x2GB) DDR3 1600Mhz Ballistix Tact... 
Hard DriveOSMonitorKeyboard
WD 1TB 3.5" SATA-III Caviar Green Internal Hard... Windows 7 Ultimate 32bit Philips E-line 247E4LHSB LED LCD 23.6" HDMI Mon... Logitech 
PowerCaseMouseMouse Pad
Antec 520W High Current Gamer PSU CiT Vantage Midi Mesh Gaming Case with HD Audio... Logitech MX518 volkswagen golf gti30 
  hide details  
Reply
post #3 of 3
Thread Starter 
thx for the link; ok, i installed the code, and it works, except after clicking "ok" on the pop-up box it forwards you to the resulting page, i want the page to stay put after the pop-up comes up, this is what i have down..
Code:
<script type="text/javascript">
function displaymessage()
{
alert("Please enter keyword(s).")
}
</script>
Code:
<ss:button type='submit' value='Search' alt="Search" title="Search" source="$templateSet.images['search.gif']" onclick="displaymessage()"/>
(the "ss:" function is just an internal code from within my ecommerce provider)
New Posts  All Forums:Forum Nav:
  Return Home
  Back to Forum: Web Coding
Overclock.net › Forums › Software, Programming and Coding › Coding and Programming › Web Coding › Creating a pop-up for a search form