WebsiteBaker Logo
  • *
  • Templates
  • Help
  • Add-ons
  • Download
  • Home
*
Welcome, Guest. Please login or register.

Login with username, password and session length
 

News


WebsiteBaker 2.13.8 is now available!


R.I.P Dietmar (luisehahne) and thank you for all your valuable work for WB
https://forum.websitebaker.org/index.php/topic,32355.0.html


* Support WebsiteBaker

Your donations will help to:

  • Pay for our dedicated server
  • Pay for domain registration
  • and much more!

You can donate by clicking on the button below.


  • Home
  • Help
  • Search
  • Login
  • Register

  • WebsiteBaker Community Forum »
  • WebsiteBaker Support (2.8.x) »
  • Droplets & Snippets »
  • searchbox extra
  • Print
Pages: [1]   Go Down

Author Topic: searchbox extra  (Read 5519 times)

snark

  • Guest
searchbox extra
« on: January 28, 2010, 04:56:45 PM »
I want to include
 onClick="if(this.value == 'fill in your searchbla here...') { this.value = ''; }" onBlur="if(this.value == '') { this.value = 'Fill in your searchbla here....'; }"

on the textfiel of the searchbox droplet


but I get a red drop...

anyone knows what to change?  in normal code this works fine

Logged

Offline crnogorac081

  • Posts: 2163
  • Gender: Male
Re: searchbox extra
« Reply #1 on: January 28, 2010, 09:14:06 PM »
Hi,

I suggest to post the whole code so coders can take a look.

cheers
Logged
Web developer

snark

  • Guest
Re: searchbox extra
« Reply #2 on: January 28, 2010, 09:57:14 PM »
'kay,

Code: [Select]
global $TEXT;
$return_value = " ";
if(SHOW_SEARCH) {
    $return_value  = '<div class="box">';
    $return_value  .= '<form action="'.WB_URL.'/search/index'.PAGE_EXTENSION.'" method="get" name="search" class="searchform" id="search">';
    $return_value  .= '<input type="text" name="string" size="22" class="boks" value="fill in your searchbla here..." onClick="if(this.value == 'fill in your searchbla here...') { this.value = ''; }" onBlur="if(this.value == '') { this.value = 'Fill in your searchbla here....'; }" />&nbsp;';
    $return_value  .= '<input name="submit" type="submit" class="buttonq" value="'.$TEXT['SEARCH'].'" />';
    $return_value  .= '</form>';
    $return_value  .= '</div>';
}
return $return_value;
Logged

snark

  • Guest
Re: searchbox extra
« Reply #3 on: February 04, 2010, 05:02:57 PM »
nobody has an idea?

Logged

Offline pcwacht

  • Posts: 2923
  • Gender: Male
    • Dutch ICT info
Re: searchbox extra
« Reply #4 on: February 04, 2010, 05:42:42 PM »
Watch the quotes and doublequotes

the '   and the "

text starts with ' and ends with '
so:
Code: [Select]
$return_value = ' some text and doublequote " " and singlequotes ' ' ';
will error since the text will be not corrct
you need to escape the ' so it will be parsed as text instead of end of text
Code: [Select]
$return_value = ' some text and doublequote " " and singlequotes \' \' ';

Code: [Select]
$return_value  .= '<input type="text" name="string" size="22" class="boks" value="fill in your searchbla here..." onClick="if(this.value == \'fill in your searchbla here...\') { this.value = \'\'; }" onBlur="if(this.value == \'\') { this.value = \'Fill in your searchbla here....\'; }" />&nbsp;'
might work


John
Logged
http://www.ictwacht.nl = Dutch ICT info
http://www.pcwacht.nl = My first
both still work in progress, since years.....

  • Print
Pages: [1]   Go Up
  • WebsiteBaker Community Forum »
  • WebsiteBaker Support (2.8.x) »
  • Droplets & Snippets »
  • searchbox extra
 

  • SMF 2.0.19 | SMF © 2017, Simple Machines
  • XHTML
  • RSS
  • WAP2