About this user

« Newer Snippets
Older Snippets »
1 total  XML / RSS feed 

Text field's default text

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..."; } ?>"
>
« Newer Snippets
Older Snippets »
1 total  XML / RSS feed