1 Reply Latest reply on Mar 2, 2007 4:21 PM by tspratt

    Error Message Returning Custom Error

      I've got a login form that checks against the login.cfc. What I'm trying to figure out is how to return a Custom Error message. This is what I have so far:

      private function receiveValidationEmail(event:ResultEvent):void {
      if (userMessage == "Success"){
      Alert.show("Your Login Information has been sent");

      private function sendCheckEmail():void {
      if (txtEmail.text != '' && txtLoginId.text != '' || txtPassword.text != '') {

      <mx:method name="validateEmail" result="receiveValidationEmail(event)">

      If the user forgets any info they will call the sendCheckEmail function:
      <mx:LinkButton label="Email Login Information?" click="currentState='Login';sendCheckEmail()"/>

      Then within the login.cfc:
      <cffunction name="validateEmail" output="false" access="public" returntype="userMessage ">

      run the query....

      <cfif query.UserEmail EQ 0>
      <cfset userMessage = 'Email'>


      <cfif query.LoginId EQ 0>
      <cfset userMessage = 'Login'>

      <cfif query.Password EQ 0>
      <cfset userMessage = 'Password'>

      <cfif query.Recordcount GT 0>
      <cfset userMessage = "Success">

      <cfreturn userMessage>

      I'm not getting Flex to pass back any "userMessage"..... Is there any example of how to send this message back to the Flex application within a "Form" element? Thank you in advance for your prompt response!