Loading ...
Sorry, an error occurred while loading the content.
 

Can be empty a field validate as email?

Expand Messages
  • aterrade
    With this code ,the user have to put a valid email adress. How can i make that the user can let de field empty to if don´t remember the mail? // Mail
    Message 1 of 2 , Jun 1, 2006
      With this code ,the user have to put a valid email adress.

      How can i make that the user can let de field empty to if don´t
      remember the mail?

      // Mail
      $subscription->AddInput(array(
      "TYPE"=>"text",
      "NAME"=>"e_mail",
      "ID"=>"e_mail",
      "MAXLENGTH"=>40,
      "Capitalization"=>"lowercase",
      "ValidationErrorMessage"=>"Is not an email",
      "LABEL"=>"<u>E</u>mail",
      "ACCESSKEY"=>"E"
      ));

      Thank you
    • fen.strat
      You need to add a value which will be accepted without any validation. You do this by the setting ValidateOptionalValue = - i.e. allow a blank value to
      Message 2 of 2 , Jun 1, 2006
        You need to add a value which will be accepted without any validation.

        You do this by the setting 'ValidateOptionalValue'=>'' - i.e. allow a
        blank value to pass as valid.

        You also need to validate it as an email so keep 'ValidateAsEmail'=>1.
        See below:


        --- In forms-dev@yahoogroups.com, "aterrade" <aterradellas@...> wrote:
        >
        > With this code ,the user have to put a valid email adress.
        >
        > How can i make that the user can let de field empty to if don´t
        > remember the mail?
        >
        > // Mail
        > $subscription->AddInput(array(
        > "TYPE"=>"text",
        > "NAME"=>"e_mail",
        > "ID"=>"e_mail",
        > "MAXLENGTH"=>40,
        > "Capitalization"=>"lowercase",

        'ValidateOptionalValue'=>'',
        'ValidateAsEmail'=>1,

        > "ValidationErrorMessage"=>"Is not an email",
        > "LABEL"=>"<u>E</u>mail",
        > "ACCESSKEY"=>"E"
        > ));
        >
        > Thank you
        >
      Your message has been successfully submitted and would be delivered to recipients shortly.