Home > DeveloperSection > Forums > alert message after entered debit card number
Ankita Pandey
Ankita Pandey

Total Post:183

Points:1285
Posted on    March-09-2013 4:32 AM

 JavaScript JavaScript 
Ratings:


 1 Reply(s)
 860  View(s)
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!



AVADHESH PATEL

Total Post:604

Points:4228
Posted on    March-09-2013 8:29 AM

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


Don't want to miss updates? Please click the below button!

Follow MindStick