Announcement

Collapse

The Alpha Software Forum Participation Guidelines

The Alpha Software Forum is a free forum created for Alpha Software Developer Community to ask for help, exchange ideas, and share solutions. Alpha Software strives to create an environment where all members of the community can feel safe to participate. In order to ensure the Alpha Software Forum is a place where all feel welcome, forum participants are expected to behave as follows:
  • Be professional in your conduct
  • Be kind to others
  • Be constructive when giving feedback
  • Be open to new ideas and suggestions
  • Stay on topic


Be sure all comments and threads you post are respectful. Posts that contain any of the following content will be considered a violation of your agreement as a member of the Alpha Software Forum Community and will be moderated:
  • Spam.
  • Vulgar language.
  • Quotes from private conversations without permission, including pricing and other sales related discussions.
  • Personal attacks, insults, or subtle put-downs.
  • Harassment, bullying, threatening, mocking, shaming, or deriding anyone.
  • Sexist, racist, homophobic, transphobic, ableist, or otherwise discriminatory jokes and language.
  • Sexually explicit or violent material, links, or language.
  • Pirated, hacked, or copyright-infringing material.
  • Encouraging of others to engage in the above behaviors.


If a thread or post is found to contain any of the content outlined above, a moderator may choose to take one of the following actions:
  • Remove the Post or Thread - the content is removed from the forum.
  • Place the User in Moderation - all posts and new threads must be approved by a moderator before they are posted.
  • Temporarily Ban the User - user is banned from forum for a period of time.
  • Permanently Ban the User - user is permanently banned from the forum.


Moderators may also rename posts and threads if they are too generic or do not property reflect the content.

Moderators may move threads if they have been posted in the incorrect forum.

Threads/Posts questioning specific moderator decisions or actions (such as "why was a user banned?") are not allowed and will be removed.

The owners of Alpha Software Corporation (Forum Owner) reserve the right to remove, edit, move, or close any thread for any reason; or ban any forum member without notice, reason, or explanation.

Community members are encouraged to click the "Report Post" icon in the lower left of a given post if they feel the post is in violation of the rules. This will alert the Moderators to take a look.

Alpha Software Corporation may amend the guidelines from time to time and may also vary the procedures it sets out where appropriate in a particular case. Your agreement to comply with the guidelines will be deemed agreement to any changes to it.



Bonus TIPS for Successful Posting

Try a Search First
It is highly recommended that a Search be done on your topic before posting, as many questions have been answered in prior posts. As with any search engine, the shorter the search term, the more "hits" will be returned, but the more specific the search term is, the greater the relevance of those "hits". Searching for "table" might well return every message on the board while "tablesum" would greatly restrict the number of messages returned.

When you do post
First, make sure you are posting your question in the correct forum. For example, if you post an issue regarding Desktop applications on the Mobile & Browser Applications board , not only will your question not be seen by the appropriate audience, it may also be removed or relocated.

The more detail you provide about your problem or question, the more likely someone is to understand your request and be able to help. A sample database with a minimum of records (and its support files, zipped together) will make it much easier to diagnose issues with your application. Screen shots of error messages are especially helpful.

When explaining how to reproduce your problem, please be as detailed as possible. Describe every step, click-by-click and keypress-by-keypress. Otherwise when others try to duplicate your problem, they may do something slightly different and end up with different results.

A note about attachments
You may only attach one file to each message. Attachment file size is limited to 2MB. If you need to include several files, you may do so by zipping them into a single archive.

If you forgot to attach your files to your post, please do NOT create a new thread. Instead, reply to your original message and attach the file there.

When attaching screen shots, it is best to attach an image file (.BMP, .JPG, .GIF, .PNG, etc.) or a zip file of several images, as opposed to a Word document containing the screen shots. Because Word documents are prone to viruses, many message board users will not open your Word file, therefore limiting their ability to help you.

Similarly, if you are uploading a zipped archive, you should simply create a .ZIP file and not a self-extracting .EXE as many users will not run your EXE file.
See more
See less

Email Dialog

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Email Dialog

    I have created a Xdialog box for sending emails directly from our program using A5's built in email client. I would like to "grey out" the "send report" button in the Xdialog box until the user enters the email address ("To") of there desired recipient. A5's built in dialog box for sending emails even takes it one step further by greying out the "Send" button until the user puts in the complete address including the ".com, .net, etc.... If someone could please tell me where in the attached code I would put the code that would grey out and disable the "send report" button until user enters "complete" email address, I would appreciate it... JON

    See attached code...
    Attached Files

  • #2
    Re: Email Dialog

    Jon,

    I have a login Dialog box that "greys out" the "OK" button until a user-id is entered. You could tweak your code to test for a valid e-mail address, and if OK, set a logical flag to allow the button to be used.

    <10&OK ?.not.(userid="").and.errmsg="">

    you would need to do some type of test during the "killfocus" event of the e-mail address entry, and if OK, then set you flag to .T.

    like this:
    <*15=ok_button_label!OK?emvalid> <15=cancel_button_label!CANCEL>

    Code:
    DELETE expression_result
    expression_result = eval(EPRPDF,form_name)
    xxAttachments = convert_type(expression_result,"C")
    ok_button_label = "&Send Report"
    cancel_button_label = "&Cancel"
    varC_result = ui_dlg_box("Email - Current Sales Report",<<%dlg%
    {region}
    To:| [%v%.60xxTo^+a_xxTo!xxTo_kilfocus];
    CC:| [%v%.60xxCC^+a_xxCC];
    Subject:| [.70xxSubject];
    Message:| [%mw%.70,8xxMessage];
    Attachments:| [.70xxAttachments];
    {endregion};
    {line=1,0};
    {region}
    <*15=ok_button_label!OK?emvalid> <15=cancel_button_label!CANCEL>
    {endregion};
    %dlg%  <<%code%
    if a_dlg_button = "xxTo_Killfocus"
    	******* YOur code to test validity of e-mail address
    	*********
    
    end if
    %code%)
    where emvalid is a logical flag you set on testing the email address.

    Tom
    Last edited by Tom Henkel; 03-29-2012, 10:13 AM.

    Comment


    • #3
      Re: Email Dialog

      Tom,
      I don't like it that when you type in the email address, the condition for the grayed out button is reached and the button then has focus. That removes your capabilities to use the enter key to navigate through the remainder of the dialog, and typing enter closes the dialog unless you mouse to a dialog field. So I use the {condition} command and don't gray the button, but instead don't show it until valid. This doesn't shift focus to the button that could closes the dialog prematurely.

      Code:
      dim emvalid as l=.f.
      dim xxto as C=""
      dim dlg_title as C="Email - Current Sales Report"
      dim a_xxto as C="test1@charter.net"+crlf()+"test2@gmail.com"
      
      varC_result = ui_dlg_box(dlg_title,<<%dlg%
      {region}
      To:| [%v%.60xxTo^+a_xxTo!evto_*];
      CC:| [%v%.60xxCC^+a_xxCC];
      Subject:| [.70xxSubject];
      Message:| [%mw%.70,8xxMessage];
      Attachments:| [.70xxAttachments];
      {endregion};
      {line=1,0};
      {region}
      {condition=(emvalid=.t.)} <15&Send Email> {condition=.t.} <15&Cancel>
      {endregion};
      %dlg%, <<%code%
      if left(a_dlg_button,5) = "evto_"
      	if a_dlg_button="evto_change"	
      		if a5_email_valid(xxTo)
      			emvalid=.t.
      		else
      			emvalid=.f.
      		end if
      	end if
      	
        a_dlg_button=""
      end if
      %code%)
      Mike W
      __________________________
      "I rebel in at least small things to express to the world that I have not completely surrendered"

      Comment


      • #4
        Re: Email Dialog

        Mike, the button doesn't get focus, it just becomes available.

        Comment


        • #5
          Re: Email Dialog

          Well Tom,
          maybe in New Jersey the Send button doesn't get focus, but here in the heartlands it does and if you type in the email address and press the enter key twice, the dialog closes because you have "pressed" the Send Report button which has focus. Try it yourself. This is your code with some changes/additions to make it work.

          Code:
          dim emvalid as l=.f.
          dim xxto as C=""
          
          ok_button_label = "&Send Report"
          cancel_button_label = "&Cancel"
          varC_result = ui_dlg_box("Email - Current Sales Report",<<%dlg%
          {region}
          To:| [%v%.60xxTo^+a_xxTo!evTo_*];
          CC:| [%v%.60xxCC^+a_xxCC];
          Subject:| [.70xxSubject];
          Message:| [%mw%.70,8xxMessage];
          Attachments:| [.70xxAttachments];
          {endregion};
          {line=1,0};
          {region}
          <*15=ok_button_label!OK?emvalid> <15=cancel_button_label!CANCEL>
          {endregion};
          %dlg%,<<%code%
          if left(a_dlg_button,5) = "evTo_"
          	if a_dlg_button="evTo_killfocus"
          		IF a5_email_valid(xxTo)
          			emvalid=.t.
          		END IF
          	end if
          	a_dlg_button=""
          end if
          %code%)
          Mike W
          __________________________
          "I rebel in at least small things to express to the world that I have not completely surrendered"

          Comment


          • #6
            Re: Email Dialog

            Thanks Tom & Mike for the help. Tom using your code, how is it possible to completely kill focus from the send button. Using your code, hitting 'enter' twice after entering email address, sends report. I like having the button visible until email field is filled in but some users use the 'enter' button instead of 'tab' button when navigating from field to field and this case would accidentally send report. Thanks... JON
            Last edited by jbk; 03-31-2012, 09:12 AM.

            Comment


            • #7
              Re: Email Dialog

              Jon,
              Yup, took me a bit but...too simple really...... remove the star from the front of the OK button code line -
              Code:
              <*15=ok_button_label!OK?emvalid> <15=cancel_button_label!CANCEL>
              Mike W
              __________________________
              "I rebel in at least small things to express to the world that I have not completely surrendered"

              Comment


              • #8
                Re: Email Dialog

                Works GREAT... Thanks Mike.

                Do have another question for you... I have the "To" & "CC" fields refer to an external table "Contacts" so that if the user can us the drop down or simply start typing the email address the field will autofill these fields. My question to you is, if the user wants send to multiple email addresses they would separate the address by a "," but by doing this the email address after the first doesn't auto populate and if they use the drop down arrow, whatever address they choose, replaces the first. Basically I would like the user to be able to choose from a list or simply start typing the second, third etc... address any have the field populate as they type.

                Once again, thanks for the help on the previous issue... JON

                Comment


                • #9
                  Re: Email Dialog

                  Just in my defense, Mike, After the Dialog closes, I test the He** out of the responses to make sure the user has keyed in all of the appropriate fields, and that they are valid entries BEFORE going on to do any processing.

                  Tom

                  Comment


                  • #10
                    Re: Email Dialog

                    No defense needed, Tom. I'm with you. My preference is to write all those checks right into the dialog code as field events. That to me is one of the reasons I like xdialog as data entry controls and one reason they are so powerful.

                    Jon,
                    If you want multi-select capabilities, I would then recomend an upfront multiselect, progressive lookup xdialog to gather the emails separate from the email dialog. I'll russel up an example a bit later.
                    Mike W
                    __________________________
                    "I rebel in at least small things to express to the world that I have not completely surrendered"

                    Comment


                    • #11
                      Re: Email Dialog

                      Here is an example of a method to accomplish what i believe you are asking for.
                      Attached Files
                      Mike W
                      __________________________
                      "I rebel in at least small things to express to the world that I have not completely surrendered"

                      Comment


                      • #12
                        Re: Email Dialog

                        Thanks Mike... Works GREAT!!!
                        Last edited by jbk; 04-08-2012, 10:19 AM.

                        Comment

                        Working...
                        X