How to validate an email address against free domain users

Hi all,
I want to validate an email address so that only users of non free domains (let's say other than yahoo, hotmail, gmail, etc) can create an account in my apex application.
I want to place a validation on the "Registration Page" but I am not sure how to proceed from then on :(
Does anybody know how I can do this ?
Kind Regards,
Ana-Maria

Hi Ana-Maria,
You can do this on two places. You can do it on the client (using javascript) or you can do this on the database (using a trigger or a check constraint). The best way is to do both.
Use something like this for the javascript bit:
<script type="text/javascript">
function checkemail(){
  var email = $v('P4_EMAIL');
  //get index of @
  var x = email.indexOf('@');
  //get the string behind @
  var behind_amp = email.substring(x+1, email.length);
  //get the index of the .
  var y = behind_amp.indexOf('.');
  //filter out the provider
  var provider = behind_amp.substring(0, y);
  var result;
  // set all wrong providers in this case
  switch(provider){
    case 'hotmail': result=false;break;
    case 'yahoo': result=false;break;
    case 'gmail': result=false;break;
  // Check the result
  if (!result){
    //The provider is bad
    alert(provider + ' is not allowed!');
    //Keep the focus on the email field
    setTimeout(function(){$x('P4_EMAIL').focus();}, 5);
</script>Set the event to the onchange of the email field (in HTML Form Element Attributes):
onchange="checkemail();"Hope this helps,
Greetings Rutger

Similar Messages

  • How to Validate Multiple email address in spry?

    How to validate multiple email address in spry framework?
    Spry validate text field can validate one email address only,
    if I the text field is for multiple emails, how can I validate
    it?

    Hello Jackson,
    The Spry Textfield was designed to work with the normal work
    flows that people currently use in most of the forms on the web. We
    tried to prevent any email injection method in the forms therefore
    the validation was designed to stop any multiple email insertion.
    In case you want to insert multiple emails you'll have to
    disable the default email validation and create your own validation
    function, more flexible. You can see a
    sample
    we did for the custom validation trying to validate a password
    strength and confirm the password.
    Cristian

  • How to validate a email address using Validation Pattern?

    Hi,
    is there any document for Validation Pattern? i m looking for a way to validate email addresses in my form.
    it's going to be something like * @ .
    i have no idea of how to do this, or maybe validation pattern is no good? use java script instead?
    any advice is appreciated!
    thanks.

    Hi erv2,
    You just need to place this script in the "exit" event of the field that u r using for email address.
    var r = new RegExp(); // Create a new Regular Expression Object.
        r.compile("^[a-z0-9_\\-\\.]+\\@[a-z0-9_\\-\\.]+\\.[a-z]{2,3}$","i");
    if( this.rawValue == null || this.rawValue == "")
    else
    var result = r.test(this.rawValue);                                              
    if (result == true) // If it fits the general form,
         true;               
    else
          xfa.host.messageBox("Please enter a valid email address ");
          this.rawValue = "";
          false;               // fail the validation.
    Thanks
    Amita
    Edited by: amita arora on Jan 20, 2009 10:44 AM

  • Verify email address against local exchange server

    I want to authenticate a web user by their email address against our Microsoft Exchange Server before granting access to controlled material. How can I access the GAL and determine if a supplied address is in our GAL?
    Is JavaMail the appropriate API to browse the Exchange GAL? JNDI? JAAS?
    Thanks for your help.

    Nevermind, JNDI / LDAP is what is required.

  • Validate Blackberry email address

    Good day everyone
    I need assistance wrt the above subject line. I want to validate my email address, however I cannot remember my password and my recovery question answer as well. I've tried the information on the BB website but its still not working. Please help me.....

    Hi and welcome to the forums!
    If you know the email address and you can;t validate it, there's a chance you can change the information and retry the validate process. The attached link shows all the needed steps.
    As far as forgetting the password and the recovery question as well, 3 strikes your out!
    It pains me to have to suggest this but you'll have to call your wireless service provider. 
    Thanks,
    Bifocals
    Blackberry Internet service manual
    Click Accept as Solution for posts that have solved your issue(s)!
    Be sure to click Like! for those who have helped you.
    Install BlackBerry Protect it's a free application designed to help find your lost BlackBerry smartphone, and keep the information on it secure.

  • How do I add email address to a cell in a Numbers spreadsheet without the appearance automatically changing color and underlining? In Excel, I would add an apostrophe at the beginning which would keep this from happening.

    How do I add email addresses in a column without them automatically converting to another color with underscores. I want the text to remain text.

    Hi Sclaire,
    Numbers > Preferences > Auto correction.
    Uncheck the indicated checkbox.
    Preferences panel image is from Numbers 2.3.
    For future questions, please indicate the versions of Numbers and of OS X you are using, as answers will differe depending on this information.
    Regards,
    Barry
    Message was edited by: Barry (Corrected arrow position)

  • I can't figure out how to delete and email address for someone that is no longer valid.

    I can't figure out how to delete an email address that is no longer valid.

    Assuming that this is on your iOS device, then you can change a contact's details via the Contacts app. If it's not linked to one of your contacts then I get a blue 'i' to the right of the email address on the popup list :
    Tapping on that gives me a second popup, at the bottom of which is :

  • Can someone please help me figure out how to "clear" recent email addresses used in Mail?

    Can someone please help me figure out how to “clear” recent email addresses used in Mail?  For example, as I begin typing a name/email address in the “To:” field, Mail begins suggesting addresses that I’ve previously used.  I don’t want any suggestions unless they are in my contacts. 
    Another example:  When using MS Outlook, it will also remember and suggest email accounts previously used, but I can arrow down and delete an account from the list so it won’t automatically popup or suggest in the future. 
    I appreciate any guidance in this matter. 

    The iOS email app stores all email recipients in a list of previous recipients which cannot be turned off. The email address autofill feature when addressing an email pulls from contacts and from the list of previous recipients which can't be prevented. There is no option to clear the list of previous recipients - not at the present time anyway.
    If you don't want any suggestions, select from contacts instead when addressing an email.

  • How to single out email addresses in a text

    Gurus,
    How can I get email addresses in a single text?
    for example if given
    '"has, Fez" <[email protected]>,"Heidinger, Matk" <[email protected]>,'
    how can I get just
    [email protected]???
    [email protected]
    ???                                 it comes in a single line but I need to have it in a column so
    the column shows a list of unique email addresses
    ebro

    Assuming consistent format you can use this
    declare @emailist varchar(1000)='has, Fez" <[email protected]>,"Heidinger, Matk" <[email protected]>,'
    select STUFF(Val,1,CHARINDEX('<',Val+'<'),'')
    FROM dbo.ParseValues(@emailist,'>,')
    WHERE LTRIM(STUFF(Val,1,CHARINDEX('<',Val+'<'),''))> ''
    See udf here
    http://visakhm.blogspot.in/2010/02/parsing-delimited-string.html
    Please Mark This As Answer if it solved your issue
    Please Vote This As Helpful if it helps to solve your issue
    Visakh
    My Wiki User Page
    My MSDN Page
    My Personal Blog
    My Facebook Page

  • Mail: How to delete an email address in the "To" field that is no longer valid

    How to delete an email address that is no longer valid but still appears as an option when typing that person's name in the field "To"; in MS Outlook this simply works by deleting that email address in the field "To" or "Cc" or "Bcc". The old, non-valid email address has been deleted in the address book and replaced by a new valid email address. When typing in the "To" field both email addresses appear as an option. Is it possible to achieve that only the valid email address is offered as an option so to avoid any confusion.

    well, when the "false" address is in the "to" field, you should see a littl' arrow pointing down and a "remove from previous recipients list.
    It should fix the problem. (and so, only keep the "good one"
    (oops, too late)
    Message was edited by: Matam

  • How to delete an email address in Mail

    A friend of mine has just changed his email address but I cannot remove his old one from Mail. I have added his new address and removed the old one from my Address book but his old address still comes up as the default when starting a new email to him.
    Any ideas would be appreciated...Cheers...

    Biggest apologies thought I was writing about iOS!?
    Am I also wrong about that too in iOS?
    LukaMac
    Re: how to delete an email address in Mail 
    Jan 16, 2012 6:53 PM (in response to Helpstonharv)
    It appears because your mail app remembers a history of addresses.
    It cannot be deleted but I think it will disappear after a certain time.
    Message was edited by: LukaMac

  • How to validate the Email in JSF 2.0

    Hi,
    I am developing web application using jsf2.0.
    In this case, I wish to validate the email field with the help of import org.hibernate.validator.Email;
    But it is not working, How to validate the email fileld...
    Thank.

    ManiForum wrote:
    ...I wish to validate the email field with the help of import org.hibernate.validator.Email;
    But it is not working, How to validate the email fileld...Are you asking on how to do it with the Email class from Hibernate? Or, are you open to other alternatives?

  • How can validate the ASM size and free space correctly?

    Dears ,,
    I faced problem in ASM size as it appeared in alert file as below
    ORA-19504: failed to create file "+DG_DATA"
    ORA-17502: ksfdcre:4 Failed to create file +DG_DATA
    ORA-15041: diskgroup space exhausted
    So we resize ASM space and large it. But we faced the same problem also although there is free space in ASM.
    It seems that the shown free space is not real.
    How can validate the ASM size and free space correctly?
    Thanks & Regards,,

    *Oracle DBA* wrote:
    Dears ,,
    I faced problem in ASM size as it appeared in alert file as below
    ORA-19504: failed to create file "+DG_DATA"
    ORA-17502: ksfdcre:4 Failed to create file +DG_DATA
    ORA-15041: diskgroup space exhausted
    So we resize ASM space and large it. But we faced the same problem also although there is free space in ASM.
    It seems that the shown free space is not real.
    How can validate the ASM size and free space correctly?
    Thanks & Regards,,
    I was having this problem. Im my case i couldn add datafiles to a tablespace despite the fact that i was having a lot of space in the asm. Try rebalancing. It might help. In my case rebalancing also didn work because it seems that there need to be a threshold space in all the disks for the rebalancing to happen which was not in my case, so i had to shrink some unused space in the tablespace and then after gaining the required space I rebalanced the disk and then the disks got rebalanced, also i was able to use the free space that was showing .

  • How to validate EDI XML payload against ECS file

    Hi All,
    How to validate an EDI XML against ecs file.
    Can you please provide steps.
    Sample EDI XML i am trying to validate against EDI_4010_850.ecs
    <?xml version = '1.0' encoding = 'UTF-8'?>
    <Transaction-850 xmlns:ns1="urn:oracle:b2b:X12/V4010/850" Standard="X12" xmlns="urn:oracle:b2b:X12/V4010/850">
    <ns1:Segment-ST>
    <ns1:Element-143>850</ns1:Element-143>
    <ns1:Element-329>000000010</ns1:Element-329>
    </ns1:Segment-ST>
    <ns1:Segment-BEG>
    <ns1:Element-353>00</ns1:Element-353>
    <ns1:Element-92>NE</ns1:Element-92>
    <ns1:Element-324>12345678</ns1:Element-324>
    <ns1:Element-373>20140703</ns1:Element-373>
    </ns1:Segment-BEG>
    <ns1:Loop-PO1>
    <ns1:Segment-PO1>
    <ns1:Element-350>001</ns1:Element-350>
    <ns1:Element-330>1</ns1:Element-330>
    <ns1:Element-212>96</ns1:Element-212>
    <ns1:Element-639>AA</ns1:Element-639>
    <ns1:Element-235_1>VC</ns1:Element-235_1>
    <ns1:Element-234_1>571157</ns1:Element-234_1>
    <ns1:Element-235_2>CB</ns1:Element-235_2>
    <ns1:Element-234_2>00100</ns1:Element-234_2>
    </ns1:Segment-PO1>
    <ns1:Loop-PID>
    <ns1:Segment-PID>
    <ns1:Element-349>F</ns1:Element-349>
    <ns1:Element-352>Rockford product</ns1:Element-352>
    </ns1:Segment-PID>
    </ns1:Loop-PID>
    <ns1:Segment-DTM>
    <ns1:Element-374>038</ns1:Element-374>
    <ns1:Element-373>20140626</ns1:Element-373>
    </ns1:Segment-DTM>
    <ns1:Loop-AMT>
    <ns1:Segment-AMT>
    <ns1:Element-522>1</ns1:Element-522>
    <ns1:Element-782>1</ns1:Element-782>
    </ns1:Segment-AMT></ns1:Loop-AMT>
    </ns1:Loop-PO1>
    <ns1:Segment-SE>
    <ns1:Element-96>#SegmentCount#</ns1:Element-96>
    <ns1:Element-329>000000010</ns1:Element-329>
    </ns1:Segment-SE>
    </Transaction-850>
    Thanks,
    Sid.

    What We have done is, took the XML which we are passing to B2B and assigned the XSD_PO_850 schema to it and validated. Its showing as Valid. Not sure, where the issue is now?

  • After I converted to OS5, the iCloud user name on my iPad is set to my email address, not my iCloud User ID.  How can I change it.  It's correct on my iPhone and MacBook.

    After I converted to iOS5, the iCloud user name on my iPad is set to my email address, not my iCloud User ID.  How can I change it.  It's correct on my iPhone and MacBook.

    You'll need to save the documents first from the incorrect iCloud account, sign out then sign in to the correct iCloud account and upload the documents to that account.

Maybe you are looking for