Hi there,
I have search functionality in my app, in which when user clicks in textbox, the text in the text box disappers. This works perfectly in chrome(6.0) but does not disappear after click in mozilla firefox(3.6) why?
// here is the code:
echo "Search: ";
echo "<input type=\"text\" class=\"smalltxt\" name= \"srchtxt\" id= \"srchtxt\" value= \"enter username\" height=\"20px\" onfocus= \"javascript:areaOnFocus(srchtxt, 'enter username');\" onblur= \"javascript:areaOnBlur(srchtxt, 'enter username');\" />";
// function called:
function areaOnFocus(element, inputText)
{
if(element.value == inputText)
{
element.value='';
}
}
function areaOnBlur(element, inputText)
{
if(element.value=='')
{
element.value = inputText;
}
}
Thank you in advance.