Alpha Software Mobile Development Tools:   Alpha Anywhere    |   Alpha TransForm subscribe to our YouTube Channel  Follow Us on LinkedIn  Follow Us on Twitter  Follow Us on Facebook

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

Time field with am / pm capitalized

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

    Time field with am / pm capitalized

    I have a UX with a numeric textbox and have used this for the time field in my program. As my data entry people are putting in the time that a job was performed I need the am or pm to capitalize. When my data entry people leave the time field I would like the am or pm to become capitalized. The Alpha client side mask I am using now is 00:00 ll but as you know this will not change my am or pm to capitals and if I use the mask 00:00 LL then my people are forced to capitalize and that is also a problem.

    I need it to happen automatically after they enter the time.

    Help?

    #2
    Re: Time field with am / pm capitalized

    This is a little bit tricky, in a sense, because from what you've written you've already tricked Alpha into letting you apply a Client-side mask to a numeric control. You don't get a "Mask" choice on a numeric control.

    However, you probably set it as character, set the Client-side Mask to 00:00 ll and then changed it back to numeric. I'm guessing.

    This, however, has absolutely nothing to do with your question. I'm assuming you want the Mask... so that people just have to enter hh mm am/pm... and not the :

    In the onBlur event of the control... put this...

    Code:
    var myTime = {dialog.Object}.getValue('myTime');
    myTime = myTime.toUpperCase();
    {dialog.Object}.setValue('myTime', myTime);
    When you leave the control, go and get the control value... uppercase it, and put it back. Make sure that's how it's being saved. It should be since you're making the field dirty.

    Comment


      #3
      Re: Time field with am / pm capitalized

      Originally posted by Davidk View Post
      This is a little bit tricky, in a sense, because from what you've written you've already tricked Alpha into letting you apply a Client-side mask to a numeric control. You don't get a "Mask" choice on a numeric control.

      However, you probably set it as character, set the Client-side Mask to 00:00 ll and then changed it back to numeric. I'm guessing.

      This, however, has absolutely nothing to do with your question. I'm assuming you want the Mask... so that people just have to enter hh mm am/pm... and not the :

      In the onBlur event of the control... put this...

      Code:
      var myTime = {dialog.Object}.getValue('myTime');
      myTime = myTime.toUpperCase();
      {dialog.Object}.setValue('myTime', myTime);
      When you leave the control, go and get the control value... uppercase it, and put it back. Make sure that's how it's being saved. It should be since you're making the field dirty.

      Comment


        #4
        Re: Time field with am / pm capitalized

        In my UX I have a control that is a textbox with the field property type as time and my control is called "timeDue". In your code do I need to change the name of anything to "timeDue"? Also when I add your code "onBlurr" where do I add it to "Action Javascript", "Text Mode" or "server side Xbasic".

        Thank you so much for your help with this issue. I have done nothing but think about this issue since i realized that Alpha didn't have anything in it's properties to correct the time lower case am / pm to upper case.

        Comment


          #5
          Re: Time field with am / pm capitalized

          take a look at this, see if this helps:
          http://screencast.com/t/BkrwyOye

          I am sure david can give you a javascript example, I find this easy to implement.
          hope this is helpful

          Code:
          dim length_time as n
          	dim time_field as c
          	time_field = e.dataSubmitted.end_time
          	time_field = remspecial(time_field)
          	length_time = len(time_field)
          	if length_time=5
          		time_field=0+time_field
          		end if
          		dim hh as c
          		dim mm as c
          		dim ampm as c
          		hh = substr(time_field,1,2)
          		mm = substr(time_field,3,2)
          		ampm = substr(time_field,5,2)
          		time_field = hh+":"+mm+ampm
          		time_field = convert_type(time_field,"Y")
          		
          		e.dataSubmitted.end_time = time_field
          something to remember:
          you don't have to save the data as it is in dialog or ux if you want to call it.
          you can change it to any type or even any fixed value via e.dataSubmitted filed holder and save it to the backend.
          say I am typing Gandhi you can save that as berger if you want.

          nifty I think.
          Last edited by GGandhi; 04-27-2014, 11:15 AM.
          thanks for reading

          gandhi

          version 11 3381 - 4096
          mysql backend
          http://www.alphawebprogramming.blogspot.com
          [email protected]
          Skype:[email protected]
          1 914 924 5171

          Comment


            #6
            Re: Time field with am / pm capitalized

            Originally posted by BillWFG View Post
            In my UX I have a control that is a textbox with the field property type as time and my control is called "timeDue". In your code do I need to change the name of anything to "timeDue"? Also when I add your code "onBlurr" where do I add it to "Action Javascript", "Text Mode" or "server side Xbasic".

            Thank you so much for your help with this issue. I have done nothing but think about this issue since i realized that Alpha didn't have anything in it's properties to correct the time lower case am / pm to upper case.
            Your code would look like this...

            Code:
            var myTime = {dialog.Object}.getValue('timeDue');
            myTime = myTime.toUpperCase();
            {dialog.Object}.setValue('timeDue', myTime);
            onBlur is a Client-side Javascript event of the control... in that case, timeDue. If you click on your control, timeDue, and then look at it's properties section on the right... scroll down and you'll see a Javascript section. In the Javascript section you'll see onBlur. Click it's builder and then, in the radio buttons at the top, select "Text mode" and then paste your code in there.

            When you exit your timeDue field, onBlur fires, and the code will run.

            Comment


              #7
              Re: Time field with am / pm capitalized

              david that works perfect.
              when i tried i do not know why it kept saying the object does not support toUpperCase()
              strange
              but still good to learn.
              thanks for reading

              gandhi

              version 11 3381 - 4096
              mysql backend
              http://www.alphawebprogramming.blogspot.com
              [email protected]
              Skype:[email protected]
              1 914 924 5171

              Comment


                #8
                Re: Time field with am / pm capitalized

                David thank you for taking the time to help me with my problem. I added it to the onBlurr and it worked perfectly. If I can help you in the future please let me know till then thank you.

                Comment


                  #9
                  Re: Time field with am / pm capitalized

                  Govindan Gandh I reviewed your code and watched the video. Thank you for that video it was very easy to follow and I would have used it but I already had added in the code that David Kates sent me. Although I enjoyed seeing another way to accomplish what I wanted and that was to capitalize the am/pm letters after the time. I was only interested in getting the control for time to look good on my form. I didn't want some to be caps and others to be lower case. So now I can do that and also I learned allot between you and Mr Kates. Thank you.

                  Are you running a class on building security framework?

                  Comment

                  Working...
                  X