JQuery onclick Clear or Reset text for TextBox

function clearTextHere(field, initialText) {
            if (field != null) {
                if (field.value == initialText) {
                    field.value = "";
                    field.style.color = "#000000";
                    if (initialText == 'Phone') {
                        $("#<%= tbxPhone1.ClientID %>").mask("999-999-9999");
                    }
                }
            }
        }

        function resetText(field, initialText) {
            if (field.value == "") {
                field.value = initialText;
                field.style.color = "#BBBBBB";
                if (initialText == 'Phone') {
                    field.value = initialText;
                    $("#<%= tbxPhone1.ClientID %>").unmask("999-999-9999");
                }
            }
        }

No comments:

Post a Comment