SoFunction
Updated on 2025-02-28

JavaScript full-width conversion implementation code


<html>
    <head>
        <title>jqueryDemo:quanjiaoNum</title>
        <script src="" src="" type="text/javascript"></script>
        <script type="text/javascript"><!--
            function changeNum(){
                var qjNum=$("input[@name=qjNum]").val();
                var toAscii=();
                if(toAscii > 65295 && toAscii < 65306 && == 11)
                {
                    var toBack = 0;
                    var temp = 0;
                    var unite = "";
                    for(var i=0;i < ;i++)
                    {
                        toAscii=(i);
                        toBack =toAscii-65248;
                        temp = (toBack);
                        unite = unite + temp ;
                    }
                    alert(unite);
                    return true;
                }
                if(toAscii > 47 && toAscii < 58 && == 11)
                {
                    alert(qjNum);
                    return true;
                }
                else{
alert("Please enter the correct mobile phone number");
                    ="";
                    return false;
                }
            }

// --></script>
    </head>
    <form name="myform" action="">
Convert Chinese numerals to Arabic numerals: <input type="text" name="qjNum"/><input type="button" value="Submit" onclick="changeNum()"/>
    </form>
</html>