Editing the Phone number format
Editing the Phone number format
I am trying to figure out but couldn't find any example on your site on how to swap the Phone Format from (xxx) xxx-xxxx on datatable display. When I double-click on that column and I am hoping to get that into xxxxxxxxxx for me to edit and then save it as it will go back to (xxx) xxx-xxxx format. Can you show me how to do that? Many thanks in advance.
Mitchell
Mitchell
This discussion has been closed.
Replies
aoColumns: [
{
indicator : 'Saving Phone Number...',
tooltip : 'Double click to select Phone Number',
callback : function () { $(".dataTables_processing").css('visibility', 'hidden'); },
loadtext : 'loading...',
type : 'text',
onblur : 'submit',
onsubmit: function (settings, original) {
var myForm = $('form', original);
$(myForm).validate({
rules: {
value: {
minlength: 10,
maxlength: 10
}
},
messages: {
value: {
minlength : 'Please enter at least 10 digits long.',
maxlength : 'Please enter no more than 10 digits long.'
}
},
onkeyup: false
});
return $('form', original).valid();
}
},
}
],
[/code]
[code]
<?php
while($row = $hPhone->fetch(PDO::FETCH_ASSOC)){ ?>
<?php echo format_phone($row['MSSP_PhoneNumber']); ?>
<?php } ?>
[/code]
For example, in the datatable grid of the phone number in a column showing (123) 123-1234 as a value. When I try to edit on that column, I want it to remove all special characters and put it into all numbers only for the user to edit whatever the value in it. Then save it and it will go back to Phone number format as (xxx) xxx-xxxx with a new value. Anyone can help me out? Many thanks.