Never been to TextSnippets before?

Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world (or not, you can keep them private!)

Text field's default text (See related posts)

Show a default text...

<script language="javascript">
        function showtxt(thisfield, defaulttxt) {
                thisfield.style.backgroundColor = '#FFFF88';
                if (thisfield.value == defaulttxt) {
                        thisfield.style.color = "#000";
                        thisfield.value = "";
                }
        } 
        function hidetxt(thisfield, defaulttxt) {
                thisfield.style.backgroundColor = '#FFFFFF';
                if (thisfield.value == "") {
                        thisfield.style.color = "#999";
                        thisfield.value = defaulttxt;
                }
        }
script>

...
<input 
  type="text" 
  name="query" 
  onclick="showtxt(this, 'Recherchez ici...')" 
  onblur="hidetxt(this, 'Recherchez ici...')" 
  style="color:#"query"])) { echo "000"; } else { echo "999"; } ?>;" 
  value=""query"])) { echo preg_replace("/[\\\\]+/", "", trim(htmlentities($_POST["query"]))); } else { echo "Recherchez ici..."; } ?>"
>

You need to create an account or log in to post comments to this site.


Related Posts