【问题标题】:I want to display the Email Id and Mobile number in masked format in drupal7? Suggestions needed我想在 drupal 7 中以屏蔽格式显示电子邮件 ID 和手机号码?需要的建议
【发布时间】:2016-04-19 09:58:47
【问题描述】:

示例。

raju327@gmail.com
9999888877

输出

rajuXXX@gmail.com 
999XXXX877

还有核心我想使用 OTP 功能来修复按钮单击 OTP 密码只有客户应该更改用户名和密码。

【问题讨论】:

  • 请分享更多示例和您的尝试?

标签: javascript jquery drupal drupal-7 drupal-6


【解决方案1】:

检查工作示例,

$(document).ready(function () {
   MobEncrypt();
   EmailEncrypt()
});

function MobEncrypt() {
var value = '9999888877';
    // make a string with x-characters
    var x = new Array(value.length - 3).join('X');
    // join this string with the tail of the value, and replace it
    alert(x + value.substr(value.length - 3));
}

function EmailEncrypt() {
var value = 'raju327@gmail.com';
    // make a string with x-characters
    var x = new Array(value.length - 5).join('X');
    // join this string with the tail of the value, and replace it
    alert(x + value.substr(value.length - 5));
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-06-14
    • 2017-08-27
    • 2021-08-29
    • 2016-06-30
    相关资源
    最近更新 更多