when the contents are loaded with ajax, the mask is not working on the input text.
What Should I do?
with thanks
Code:
$.ajax({url: path, data: {action:'create_form_profile'}, timeout:5000, type:"POST", success: function(data) {
$("#_content").html(data);
{
$("#birth_date").mask("9999/99/99");
}
$("input:hidden").click(function(event) {
window.location.href = "logout.php";
show_exit();
});
}
});
For me works this in ajax callback:
$('.phone').unmask().mask(phoneMask);
I don't understand why adding the same mask second time disables it..
fire a change event on the input after changing its contents via ajax.
if the entire input comes from ajax then run the mask plugin on it and then fire the change event.
IE:
$("#birth_date").mask("9999/99/99").change();
I found the reason ;)
jquery.hotkeys-0.7.9.min.js was the cause.
I have the following js files included:
<script type="text/javascript" src="js/jquery-1.6.4.min.js"></script>
<!--<script type="text/javascript" src="js/jquery.hotkeys-0.7.9.min.js"></script>-->
<script type="text/javascript" src="js/_links.js"></script>
<script type="text/javascript" src="js/_mask.js"></script>
<script type="text/javascript" src="js/_lib.js"></script>
<script type="text/javascript" src="js/_general.js"></script>
<script type="text/javascript" src="js/_jq.js"></script>
and when I removed the second file, it was so