Get week no as input

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • beulajo
    New Member
    • Nov 2009
    • 29

    Get week no as input

    I have field to get week no from the user. The week starts from Friday

    I need to give ratings for a week
  • ThatThatGuy
    Recognized Expert Contributor
    • Jul 2009
    • 453

    #2
    could you explain what exactly youre trying to do

    Comment

    • tlhintoq
      Recognized Expert Specialist
      • Mar 2008
      • 3532

      #3
      Originally posted by beulajo
      I have field to get week no from the user. The week starts from Friday

      I need to give ratings for a week
      What exactly is your question? How do you get a number from the user?

      Comment

      • beulajo
        New Member
        • Nov 2009
        • 29

        #4
        User maintains a checklist of client's daily activities like gettingup, houser chores etc, for each activity, rating is done (5,4,3,2,1). This rating is done every week. Now how do I get this as input from the user. Right now , week no is manually entered in a sheet (1,2,3,4,5). What could be the best way to get this type of input from the user

        Comment

        • tlhintoq
          Recognized Expert Specialist
          • Mar 2008
          • 3532

          #5
          So you just want to know what is the best way for the user to enter a choice of 1-2-3-4 or 5?
          5 radio buttons.
          A numericUpDown with limits of 1-5.
          A combinationlist with values of 1-5.

          Comment

          • beulajo
            New Member
            • Nov 2009
            • 29

            #6
            No. I want to know what is the way to get week no from the user.
            I can get the date easily, but the user maintains only week numbers
            so what I did is this, Year, month and week numbers separately from the users
            and again I should not allow the user to enter for future weeks
            Hope you understand now

            Comment

            • tlhintoq
              Recognized Expert Specialist
              • Mar 2008
              • 3532

              #7
              If you aren't going to allow anything but the current week then don't bother the user for it. Use the "WeekOfYear " function.

              If you are going to allow past weeks, but not allow future weeks, then provide a numericUpDown with an upper limit of the current week - which you can get from the WeekOfYear method.

              Comment

              • beulajo
                New Member
                • Nov 2009
                • 29

                #8
                I have year in a text box, months in combo and 1-5 weeks in another combo
                So now the fields are Year, Month and Week number. If user selects 5th week number for a month which has only 4 weeks, I display them appropriate message. Now my problem is, no where I get the date from the user, instead I get week number. Now how do I restrict user from entering for Future week
                Ex: The user is allowed to rate only till 2009 November 4th week not for 5th week. How do I validate this?. This would be still clear

                Comment

                • tlhintoq
                  Recognized Expert Specialist
                  • Mar 2008
                  • 3532

                  #9
                  If user selects 5th week number for a month which has only 4 weeks, I display them appropriate message.
                  Stop right there. Don't scold your user for choosing an option that you gave them. You should programmaticall y change the user's possible options to only those that are valid. You have to make the check anyway, so do it before not after they make a selection.

                  Now how do I restrict user from entering for Future week
                  Programmaticall y change the list of items in the combo.
                  if year is less than this year then you can have all the months
                  if year equals this year then you can only have months until this month
                  if year equals this year and months equals this month then you can have weeks until this week.

                  Comment

                  • beulajo
                    New Member
                    • Nov 2009
                    • 29

                    #10
                    yeah this idea is good. I did not think in this way. I was trying to validate after the user could enter the data using javascript which was bit tiresome. Thanks for giving this solution.

                    Comment

                    Working...