Jump to content

DirectI Registrar Module - hard work for Brazil


brasiweb

Recommended Posts

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.

Link to comment
Share on other sites

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;

 

}

Link to comment
Share on other sites

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! :)

Link to comment
Share on other sites

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>

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated