brasiweb Posted July 16, 2007 Share Posted July 16, 2007 Hi, Matt! Here on Brazil we have the telephone number commonly inserted in a strange way, compared to EUA, with area code inside parenthesis, and a hiphen in middle number: (XX) YYYY-ZZZZ I'm having some trouble with DirectI, since they don't allow ANY alpha characters: I have to edit all customers telephone numbers frequently, to avoid interruptions in domain register automation through DirectI, and sometimes customers re-edit their phone numbers... May you do some arrangements in DirectI module functions to read the telephone field removing the spaces, parenthesis and hiphens when registering a domain? XXYYYYZZZZ are 10 characters, the max allowed by DirectI (excluding the Country Code). And, maybe, add a Country Code field also, with a pre-inserted code when registering (since a lot people here doesnt even know the existence of a code for each Country)? Thanks in advance. 0 Quote Link to comment Share on other sites More sharing options...
trine Posted July 16, 2007 Share Posted July 16, 2007 Add some javascript to transform the text 0 Quote Link to comment Share on other sites More sharing options...
brasiweb Posted July 16, 2007 Author Share Posted July 16, 2007 It's a great idea, but where? Did you use JS with WHMCS already to alter any data? 0 Quote Link to comment Share on other sites More sharing options...
trine Posted July 16, 2007 Share Posted July 16, 2007 you can create a function on the telephone input boxes to call a function... ie: <input name="phonenumber" size="20" value="" type="text" onchange="javascript:translatenumbers(this.value,'telno');" id="telno"> then write your function... something like: function translatenumbers(str,myid){ str = str.replace(/(A|B|C)/ig, "2"); //...do the rest here ... etc ... //...then pass it back to the input box... document.getElementById(myid).value = str; } 0 Quote Link to comment Share on other sites More sharing options...
brasiweb Posted July 16, 2007 Author Share Posted July 16, 2007 Thanks, trine. But i'm a leading zero in JS... I will ask some friends if they could do it for me. Again, Thanks!! And thanks for the info I can move services through DirectI accounts, also, if you didnt read there topic again! 0 Quote Link to comment Share on other sites More sharing options...
trine Posted July 16, 2007 Share Posted July 16, 2007 brasiweb, try the following. Modify the phonenumber input to read: <input name="phonenumber" size="20" value="" type="text" onchange="javascript:translatenumbers(this.value,'telno');" id="telno"> Insert your <script language="javascript" type="text/javascript"> function translatenumbers(str,myid){ // replace all A-Z characters in phone field: // (this is a case insensitive replace) str = str.replace(/(A|B|C)/ig, "2"); str = str.replace(/(D|E|F)/ig, "3"); str = str.replace(/(G|H|I)/ig, "4"); str = str.replace(/(J|K|L)/ig, "5"); str = str.replace(/(M|N|O)/ig, "6"); str = str.replace(/(P|Q|R|S)/ig, "7"); str = str.replace(/(T|U|V)/ig, "8"); str = str.replace(/(W|X|Y|Z)/ig, "9"); //...then pass it back to the input box... document.getElementById(myid).value = str; } </script> 0 Quote Link to comment Share on other sites More sharing options...
brasiweb Posted July 16, 2007 Author Share Posted July 16, 2007 Hum... Now i understand it. But i think you don't understand what i need. I just need the spaces are removed, not translate it from letter to numbers. I use XXYYYYZZZZ just to show the format i need it. Ex: (11) 5543-9876 +55 11 5543-9876 (011)55439876 etc... shoud all be turned on: 551155439876 Got it now? remove spaces, hiphens, paranthesis and plus characters, and initial zero if have... and check if it have 55 at start. If dont, automatically add it. Thanks if someone can help. 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.