ALERT MESSAGE AFTER ENTERED DEBIT CARD NUMBER

Ankita Pandey

Total Post:183

Points:1285
Posted by  Ankita Pandey
 1181  View(s)
Ratings:
Rate this:

Hi Mindstickians!

I want to display alert message of entered text from textbox, after entered debit card number by users for just confirmation.

Debit card number format as following
9585-5845-6525-4751

Thanks in advance!

  1. AVADHESH PATEL

    Post:604

    Points:4228
    Re: alert message after entered debit card number

    Hi Ankita!

    You could try following line of code

    <script src="../../Scripts/jquery-1.7.1.min.js" type="text/javascript"></script>
    <script src="../../Scripts/jquery.maskedinput.js" type="text/javascript"></script>
    <script type="text/javascript">
        jQuery(function ($) {
             $("#txtAlert").mask("9999-9999-9999-9999", { completed: function () { alert("You typed the following: " + this.val()); } });
        });
    </script>

    <input id="txtAlert" type="text" />

    Note:
    "jquery-1.7.1.min.js" provided by MVC application
    "jquery.maskedinput.js" you can download from following link

    https://raw.github.com/digitalBush/jquery.maskedinput/1.3.1/dist/jquery.maskedinput.min.js

Answer

NEWSLETTER

Enter your email address here always to be updated. We promise not to spam!