Sunday, July 8, 2012

Default toggle text in input text box magento

<script language="javascript">
var comment = document.getElementById('comment');
comment.onfocus = hideText;
comment.onblur  = showText;
function hideText()
{
if(this.value == this.defaultValue){
this.value = '';
this.style.color = '#666666';
}
}
function showText()
{
if(this.value == ''){
this.value = this.defaultValue;
this.style.color = '#cccccc';
}
}
</script>

No comments:

Post a Comment

Please mention your comments.......