How to use EmailValidator to validate a simple string instead of TextInput

Hello

I would use EmailValidator for validate if a string is a valid email address. But I got an exception when I tried to put the source chain.

var tmp:string = [email protected] ;

var emailVal:EmailValidator = new EmailValidator();

emailVal.source = tmp;

I know that we usually do

emailVal.source = new TextInput()

emailVal.property = "text".

But here, I just want to validate a string. How can I do?

Kind regards

Haibin

Use the validate() method, which returns the validationresultevent; now, you can check the property type of the event.

Code:

var tmp:String = "[email protected]";

var emailVal:EmailValidator = new EmailValidator();
var vr:ValidationResultEvent = emailVal.validate (tmp);
if(VR.type == ValidationResultEvent.valid)
; It is valid
on the other
; It is not valid

Tags: Flex

Similar Questions

  • How to use regexp_like to validate a string

    Hi all

    We want to validate a column value, which must be of 'a - z' and ' / '.
    We try to use regexp_like for this, but it does not work.

    By example, "abcd/efgh" is valid, and ' ab.cd / ef - gh' is not valid.

    SELECT 'PASS '.
    OF THE DOUBLE
    WHERE regexp_like('abcd/efgh','[a-z]|[]')

    We hope that the result is PASS, and the result is PASS, too.

    SELECT 'PASS '.
    OF THE DOUBLE
    WHERE regexp_like('ab.cd/ef-gh','[a-z]|[]')

    We hope that the result is NOT PASS, but the result is always PASS.?!

    How can we use regexp_like to validate a string with specific characters?

    Any suggestion will be appreciated.

    Best regards
    Zhxiang

    Hello

    Connected to Oracle Database 10g Express Edition Release 10.2.0.1.0
    Connected as hr
    
    SQL>
    SQL> with data as(
      2  select 'abcd/efgh' as d from dual union all
      3  select 'ab.cd/ef-gh' as d from dual)
      4  select * from data where regexp_like(d, '^[a-z/]+$');
    
    D
    -----------
    abcd/efgh
    
    SQL> 
    

    Kind regards

  • How to use CFPARAM with a list of string values

    Hi all

    I have a field value that can be stored with multiple values for a single record: Work_Order = '555555,666666,111111' (note that these are actually stored as a single string value in the comics with commas.)

    I need to analyze this field and enter a new query clause where the string values:

    < CFSET WOIDS = CapProjects.Work_Order >

    < cfloop condition = "#find(',,',WOIDS) #" >

    < cfset WOIDS = "#rereplace (WOIDS, ',',', null, ',' ALL') #" > < br >

    < / cfloop >

    < cfquery name = "CapProjectsWOIDS" datasource = "#URL. DB #">"
    SELECT [ENGOPSMTRLSID]
    [Work_Order]
    OF ENGOPSMTRLS
    WHERE
    < CFOUTPUT >
    ENGOPSMTRLSID = #URL. INDEX #.
    < / CFOUTPUT >
    AND
    < CFOUTPUT >
    Work_Order in (< cfloop index = list "idx" = "#variables.) WOIDS #">"
    < cfqueryparam
    value = #WOIDS #.
    cfsqltype = "cf_sql_varchar".
    list = 'true '.
    (/ > < / cfloop >)
    < / CFOUTPUT >
    < / cfquery >

    I'm doing this right? I get the following error: error running query database. [Macromedia] [SQLServer JDBC Driver] [SQL Server] Incorrect syntax near '@P4 '. What's the length of the loop? How do I drop?

    Thank you

    John

    First of all, you need not use CFOUTPUT in a CFQUERY (or most / all other CFtags)-CF knows.

    Second, you need not complete a list for an 'IN '.  Unless you use a dark database is not MS - SQL, MySQL or Oracle.  And you already know that CFQUERYPARAM has an attribute from the list.

    NOTE: This assumes that the Work_Order data type is char or varchar, not whole.

    
      SELECT [ENGOPSMTRLSID]
          ,[Work_Order]
      FROM ENGOPSMTRLS
      WHERE  ENGOPSMTRLSID = #URL.INDEX# /* <--- I didn't see URL anything, before this.  And I REALLY cannot stress how bad of an idea it is to use a URL variable for your DSN.  Just sayin'.  */
    AND
      Work_Order in  ()
    
    

    Given that you use for the varchar type, you must put quotation marks around the value (line 08), as I have demonstrated.

    HTH,

    ^_^

  • How to use the input as VC Atttibutes string?

    Hello everyone,

    I'm discovering VCO. And I need your help.

    How can I use input string as a VC attributes at the end? Then, use this return as input for another workflow.

    The workflow that I am putting in place is:

    1-name of the VM to search in vCenter: input String (example: 'TOTO')

    2-search 'TOTO' virtual machine in the vCenter, if found then

    3 - use this result to clone a VM TOTO

    For stage 1 and 2, it works, I can search based on the input of the chain and get a result.

    But for step 3, I use another workflow 'Create virtual machine' and we must put a VC:VirtualMachine.

    And it does not work because the type I get to step 2 is not compatible with the entry for step 3.

    Progressive input signal 3 waiting for VC:VirtualMachine

    And the output of step 2 is the table / VC:VirtualMachine.

    I tried to change the input type for step 3 as table / VC:VirtualMachine.

    Whenever I got the error message:

    TypeError: Cannot find the cloneVM_Task function in the DynamicWrapper (Instance) subject: [VcVirtualMachine]-[class com.vmware.vmo.plugin.vi4.model.VimVirtualMachine] - VALUE: VirtualMachine, vm-907 > "LYNC01." (Name of the dynamic Script Module: cloneVM_1 #13)

    I don't want the workflow using the VC search plugin, but I need to set the input parameter.

    If someone has an idea.

    Thank you all.

    Keep the entry for step 3 as VcVirtualmachine (only one), but add an extra step:

    2.5: get the first (or last, should not question: I hope that you will find only one :-)) table.)

    You can do it in Javascript, using the method. pop() from an array.

    var sourceVM = foundVMs.pop () / / sourceVM is of type VcVirtualMachine, foundVMs table/VcVirtualMachine

    See you soon,.

    Joerg

  • How to use a generic button to present xml instead of pdf?

    Hi all.

    I use the javascript code that I found to send a form:

    var object is form1. SF1. TxtFld1.rawValue.concat (_form1. SF1. TxtFld2.rawValue);

    myDoc = event.target var;

    try {}

    myDoc.mailDoc({)

    bUI: false,

            cTo: ' [email protected] ',

    bassujetti: object,

    cSubmitAs: 'XML '.

    });

    } catch (e) {}

    exception management...

    }

    I want to change the above to the xml instead of the PDF by email.  Can anyone help?

    I'm not using the submit button it's because I can't understand how to customize the subject line as I have in the above script.

    If there is a better way to do what I need, please let me know - I'm open to suggestions.

    Thank you

    J

    
    
    

    I had a typo in the code. Try this:

    event.target.submitForm ({cURL: "mailto:"+""+"? & body ="+"this is a test e-mail"+"& subject =" + subject + "", cSubmitAs: "PDF", cCharset: "utf - 8"});

  • How to use REGEXP to exactly the corresponding strings?

    Version: Oracle enterprise edition 10G

    Hello developers,

    I'm trying to stripe some of the words in the url that I already know and have no importance.
    Here is the piece of code that I tried.
    SELECT REGEXP_REPLACE( '-THE-WORLD-IS-NOT-ENOUGH-FOR-ME-','[-FOR-|-THE-|-NOT-]','RPLCD') FROM DUAL
    I did that to replace - THE-, - for - and - NOT-in the url of the form. But it does not supersede the right word and replaces all the letters that are being matched. I know that I use a bad model to this feature.

    Can someone help me to form a model that replaces the entire word we give or one similar to it? and without taking into account the case too

    Thank you
    RAM

    You want between parentheses, square brackets:

    SQL> ed
    Wrote file afiedt.buf
    
      1* SELECT REGEXP_REPLACE( '-THE-WORLD-IS-NOT-ENOUGH-FOR-ME-','(-FOR-|-THE-|-NOT-)','RPLCD') FROM DUAL
      2  /
    
    REGEXP_REPLACE('-THE-WORLD-IS-NO
    --------------------------------
    RPLCDWORLD-ISRPLCDENOUGHRPLCDME-
    
    SQL>
    

    square brackets indicate a set of characters, whole words.

  • How to use a script to validate the same field with different addresses in different pages?

    I have a script that is applied to a field 'email '.

    The script asks to check the address, if it is not well written.

    But this field is present in many pages for different guests filling in this information.

    How can I adapt this script? (without changing the name of each field of each page and therefore to change the value in the script to a page that ...)

    function confirm_email_OnValidate (element)

    {

    Event.RC = confirm_email_Validate (Element, event.value);

    }

    function confirm_email_Validate (Element, newvalue)

    {

    If (newvalue.length < = 0)

    Returns true;

    Model = newvalue.replace (/ [a-zA-Z0-9] + ((\.| _ | \-) [a-zA-Z0-9] +) * @([a-zA-Z0-9] +(\.| \-))+[a-za-Z]{2,}/, «»);)

    If (Dummy.length! = 0)

    {

    InputError (element, 'Check this address');

    Returns false;

    }

    Returns true;

    }

    function confirm_email_Format (element)

    {

    Returns true;

    }

    You can use the eMailValidate built-in function to simplify this. For example, you can use the custom following validation script:

    if (event.value && !eMailValidate(event.value)) {
        app.alert("Check this address");
        event.rc = false;
    }
    

    It provides a validation better than the regular expression that you have demonstrated.

    Without knowing how you use the parameter of the element and the operation of the function InputError, it is difficult to offer something more.

  • I'm not clear how to use the recovery CD

    I added all the space using my HDD is it comes about 12 GB, I have 27.9 GB of disk space, but my drive has only 1.80 left disk space. I made clear to solve this problem. Basket is empty, I ran disk cleanup.

    A computer expert suggested that Windows might have become confused and cannot recognize what place I save, it might be because I ran a program called Cyberscrub often. His solution is to reload Windows XP home. My laptop came with recovery discs, everything else is already loaded. I have so much I don't want to lose on my laptop. If I use the recovery discs, I will lose everything on my computer, am I better off buying Windows XP home and re-load, in which case I will not lose my job?

    Also I am not clear how to use the recovery discs, I can't find instructions on what you are doing.
    The only person who could help me went to travel and not reachable.
    Any help greatly appreciated
    Lorraine Hart

    It of a very simple to recover the laptop.
    Just boot from the recovery CD and follow the instructions on-screen ;)

    I put t know what version recovery CD you have, but the older one provides the standard and expert mode. In expert mode, you can choose you partition where the OS is to be installed.
    So in this case only the selected partition will be formatted!

    But have you checked the size of the HARD disk in disk management?
    Simply click on the my icon my computer and choose manage.

    Of course, you could remove the internal HARD disk and it could connect to the external USB HDD controller. Then, connect the drive HARD to the second PC and you record data on another HARD drive.

  • Qosmio F20-155: how to use BT to share files with the mobile phone

    Hello
    I HAVE TOSHIBA QOSMIO F20-155, BUT I DON'T NO HOW TO USE BLUETOOTH TO SHARE FILES WITH MY CELL PHONE
    PLEASE HELP ME

    Hello

    First a simple question: are you sure that your laptop supports Bluetooth?
    AFAIK the Qosmio F20-155 was delivered without the BT module.

    In addition, if you are not sure if the phone has BT then you can check the bottom of the unit. It should be placed a label BT if the Bluetooth has been installed.

  • How to use RAS queue?

    Hi all

    So I have some difficulties to use the queue of the hunting event, I would like to know how to use it before you put it, I use a very simple test of Vi.

    So, if anyone has an idea?

    Thanks for the future repply

    Looks better,

    Guillaume.

    Read the care and recommendations for using events in LabVIEW - LabVIEW 2013 help .

  • How to use the node function call library for a function in the dll with the data SUB type

    Hi all

    I would ask for your kind help

    I am facing a problem with the call library node.

    I have a C++ (stdcall) function, which has Sub as data type

    XXXX error code (hwnd, lid, getValue, * Sub data1, * Sub data2)

    data1 and data2 types are constantly changing based on the value of 'getValue '.

    Mainly I can use the call library node several times and adapt each node according to the types of data data1, data2 and extract the values and use in the code. Here is no question. Real question is:

    My question:

    How can I use a node of library time call and make a case according to the 'getvalue', who will control the data1, data2 data type. Here I really seeking solutions.

    My tests:

    I used varaints as entry to the libray call node of the data1, data2 and selected parameters in the call libraby node as "Adapt to type. Here labview just crashed.

    I appreciate your suggestions to feedbackand.

    Thank you

    Karine

    You must allocate enough space for data1 and data2, and then pass a pointer to this space. An easy way to do this is the function to initialize table. Set the U8 type and size for the number of bytes required. Pass this array to the function as a pointer of table data.

    After the function call returns, you need to extract the data in the table. You can do it manually, but a simple approach is to use the array of bytes to a string. Then, in a housing structure, use Unflatten chain to convert the string to the correct data type. This method also converts the "endianness" which will be probably necessary; Be sure to only set all entries for unflatten correctly.

  • PID control using USB-6009, need of simple video or example vi

    I have a new usb-6009 and have tried all the videos on the NC

    Web site for practice. However with the version 8.6.1 I can't use

    the pid simple vi which is used on the video. (its too old 5 x v)

    I just need a PID simple vi to 8.6.1.so that day, I saw many complexes of vi

    for the demo of pid... I'm creating control tools... too to choose...

    any help looking for a simple vi or video? - as the demo shown

    the NI USB-6009 Web site...

    Concerning

    JJ

    Well, I did a simple proportional control for box usb-6009

    with a time inside the while loop... don't know if it's the

    Gourmet addresses... my sub PID vi is very simple...

    But it shows how to use labview and usb-6009 for case

    a loop very simple return PID...

    Concerning

    J

  • How to use control arrays

    Is there a tutorial on how to use control arrays in LabWindows?

    It is quite simple to create in IUR, but the coding is not what I was hoping.

    I tried this

    for (iLoop = 0; iLoop = iNumberofControls; iLoop ++)

    SetCtrlVal (Panel, CRTLARRAY [iLoop], value);

    Hello

    I am aware of the manual, http://zone.ni.com/reference/en-XX/help/370051T-01/cvi/uiref/programming_with_control_arrays/and the userint\ledctrlarray.cws (very) brief example

  • How to use Event Viewer to erase the mistakes/Vista

    How to use the event viewer.in performance information a tools / tools... built a lot of mistakes over time... Vista Home Basic to system op.  also it would help to speed up my computer?... can someone help me please...

    Hello

    To add to the good advice of dax1792:

    MyEventViewer can be verified at the time of the EVENT or the blue screen (BSOD) within a second
    then the EVENT or time of the BSOD for more information on the possible cause - see TIP.

    MyEventViewer - free - a simple alternative in the standard Windows Event Viewer.
    TIP - Options - Advanced filter allows you to see a period of time instead of the whole of the record-
    Set it a bit before and after the time of the EVENT or the BSOD.
    http://www.NirSoft.NET/utils/my_event_viewer.html

    This ulilty also lets you clean (remove) one, several or all the logs in Event Viewer. Only
    real reason to remove them would be to make it easier to read all the new events - those recording after
    compensation.

    ------------------------------

    TechNet - observer of events
    http://TechNet.Microsoft.com/en-us/library/cc766042.aspx

    TechNet - clear an event log
    http://TechNet.Microsoft.com/en-us/library/cc722318.aspx

    I hope this helps.
    --------------------------------------------------------------------------------------------
    Rob Brown - Microsoft MVP<- profile="" -="" windows="" and="" devices="" for="" it :="" bicycle="" -="" mark="" twain="" said="" it="">

  • How to use my webcam to make a video?

    Original title: Videos

    I asked 3 times how to use my webcam to make a video. I used for the design of critical systems of path for Lunar Missions manned Apollo and if I had received answers to my questions as answers to engineers gave three first astronauts would be dead.  I went to Georgia Tech and an engineer means something tangible like electrical, Civil, aerospace, industrial etc etc.

    For someone who wants a simple answer, you ask with a lot of extraneous information.

    I responded to one of your other queries (even more) on the same...

    http://answers.Microsoft.com/en-us/Windows/Forum/Windows_7-pictures/webcam/7e9e2483-808e-44A6-ac0e-ea7f173410b1

    Also, looking at your profile I don't know WHERE you have asked three times about it - but it was not these forums.  Click on the following link to see your profile and questions you asked, those to which you have subscribed, etc.. :

    http://answers.Microsoft.com/en-us/profile/b724118b-5491-4264-8798-4e4b18d48cdb

Maybe you are looking for

  • Version coat colour space grey Apple Watch?

    I was wondering if there has been recent updates regarding the peeling on the underside of the version of the gray area of the Apple Watch around the Apple logo, and if this is still the case. If it happens again it was sorted before the release date

  • Re: Unable to connect by Satellite C660 for TV

    Hello Please be gentle, I'm new here! I bought a new HDMI cable to connect my laptop to the TV, but nothing happens.The processor usage is Intel64 family 6 model 23.Ehwn I click on the parameters of the monitor/TV, that is to say that the ' TV/monito

  • Equim L350D - 11 d boot more

    I had uninstalled Mcafee Internet security 2 weeks ago to install Trend Micro (it was free of my ISP) and have had problems since. It started with a software conflict so I uninstalled the software and the laptop has continued to function properly, bu

  • What card Firewire works with Satellite L40-139?

    I have Satellite L40-139 under Vista Home Premium.The laptop doesn't have a Firewire interface. He has a 54mm Express card slot. I would like to add a Firewire interface, so I can import video from a camcorder. If I understand correctly, it should be

  • BLUE SCREEN: STOP 0 X 00000019 (0X00000020, 0X89E4B688, 0X89E4B6D0, 0X0A090001)

    Had "BAD-POOL-HEADER" blue screen a few minutes ago. Had several tabs on google chrome running and watching videos on youtube, and then running Disk Defragmenter I got this blue screen with code 0 x 00000019 (0x00000020, etc...). Recently installed n