1 2 Previous Next 24 Replies Latest reply on Feb 11, 2015 2:05 PM by fac586 Go to original post
      • 15. Re: Re: Field focus after validation error
        Kiran Pawar

        Hi fac586,

         

            Thanks for your clarification regarding the jQuery :input selector. I misunderstood it for input selector.

            So, the jquery selector for dynamic action would be:

        :input.apex-page-item-error:first
        

             or this:

        .apex-page-item-error:first
        

             Both of them will work as intended in the question.

         

        Regards,

        Kiran

        • 16. Re: Field focus after validation error
          HRSysAdmin

          Thank you Kiran and fac586.

          Solution working perfectly

          • 17. Re: Re: Field focus after validation error
            HRSysAdmin

            Apologies for being awkward, but I may have spoken too soon.

             

            My form has dynamic regions which hide/show depending on the value in an item (select list).

            For example, if "Commercial" is chosen from the select list then the customer is asked to provide Organisation details. If "Domestic" is chosen, then the customer is asked to provide Customer details.

             

            The solution works if the Customer Details validations error (as these fields are technically before the organisation fields), but not if the other region's (Organisation Details) validations error.

             

            Help!

            • 18. Re: Field focus after validation error
              fac586

              HRSysAdmin wrote:

               

              Apologies for being awkward, but I may have spoken too soon.

               

              My form has dynamic regions which hide/show depending on the value in an item (select list).

              For example, if "Commercial" is chosen from the select list then the customer is asked to provide Organisation details. If "Domestic" is chosen, then the customer is asked to provide Customer details.

               

              The solution works if the Customer Details validations error (as these fields are technically before the organisation fields), but not if the other region's (Organisation Details) validations error.

              Is it possible the items in the hidden region are also failing validation? Check the page source to see if they have the apex-page-item-error class applied.

               

              Are the validations conditional on the select list value? They should only be executed for the items that are actually visible.

              • 19. Re: Field focus after validation error
                HRSysAdmin

                I can confirm that the Organisation validations are conditional on the first select list being equal to "Commercial" and the Customer validations are conditional on the select list being equal to "Domestic."

                 

                Is there anything else I'm missing?

                • 20. Re: Field focus after validation error
                  fac586

                  HRSysAdmin wrote:

                   

                  I can confirm that the Organisation validations are conditional on the first select list being equal to "Commercial" and the Customer validations are conditional on the select list being equal to "Domestic."

                   

                  Is there anything else I'm missing?

                  What jQuery selector are you using in the dynamic action?

                   

                  Can you reproduce the problem with an example on apex.oracle.com?

                  • 21. Re: Field focus after validation error
                    HRSysAdmin

                    To replicate issue:

                    Select cateogry Commercial > Scroll to bottom of page > Click button Click here to submit your request

                    Validation errors appear but cursor not set to first error field.

                    If you select category Domestic and Submit, cursor set to first error field.

                     

                    If anything is unclear, please ask.

                    Many thanks.

                    • 22. Re: Re: Field focus after validation error
                      fac586

                      The jQuery selector is returning the P1_CUSTOMER_POST_CODE item as the first field with an error, which suggests that there is a problem with the conditions on your validations.

                       

                      <input type="text" id="P1_CUSTOMER_POST_CODE" name="p_t19" class="text_field apex-page-item-error" tabindex="10" value="" size="8" maxlength="8">
                      
                      
                      
                      

                       

                      From the Conditional Validations utility report it looks like the wrong expression has been used in the MANDATORY_CUST_POST_CODE validation:

                       

                      PageValidationCondition TypeExpression 1Expression 2
                      1MANDATORY_CONT_CONTACT_FIRSTNAMEValue of Item / Column in Expression 1 = Expression 2P1_ON_BEHALFY
                      1MANDATORY_CONT_CONTACT_SURNAMEValue of Item / Column in Expression 1 = Expression 2P1_ON_BEHALFY
                      1MANDATORY_CONT_CONTACT_TITLEValue of Item / Column in Expression 1 = Expression 2P1_ON_BEHALFY
                      1MANDATORY_CONT_CUST_FIRSTNAMEValue of Item / Column in Expression 1 = Expression 2P1_ON_BEHALFY
                      1MANDATORY_CONT_CUST_POST_CODEValue of Item / Column in Expression 1 = Expression 2P1_ON_BEHALFY
                      1MANDATORY_CONT_CUST_SURNAMEValue of Item / Column in Expression 1 = Expression 2P1_ON_BEHALFY
                      1MANDATORY_CONT_CUST_TITLEValue of Item / Column in Expression 1 = Expression 2P1_ON_BEHALFY
                      1MANDATORY_CUST_ADDRESSValue of Item / Column in Expression 1 = Expression 2P1_ON_BEHALFN
                      1MANDATORY_CUST_FIRSTNAMEValue of Item / Column in Expression 1 = Expression 2P1_PROBLEM_CODEDOM
                      1MANDATORY_CUST_POST_CODEValue of Item / Column in Expression 1 = Expression 2P1_PROBLEM_CODEN10
                      1MANDATORY_CUST_SURNAMEValue of Item / Column in Expression 1 = Expression 2P1_ON_BEHALFN
                      1MANDATORY_CUST_TITLEValue of Item / Column in Expression 1 = Expression 2P1_PROBLEM_CODEDOM
                      1MANDATORY_ORG_CONTACT_FIRSTNAMEValue of Item / Column in Expression 1 = Expression 2P1_PROBLEM_CODEN10
                      1MANDATORY_ORG_CONTACT_SURNAMEValue of Item / Column in Expression 1 = Expression 2P1_PROBLEM_CODEN10
                      1MANDATORY_ORG_CONTACT_TITLEValue of Item / Column in Expression 1 = Expression 2P1_PROBLEM_CODEN10
                      1MANDATORY_ORG_NAMEValue of Item / Column in Expression 1 = Expression 2P1_PROBLEM_CODEN10
                      1MANDATORY_ORG_POST_CODEValue of Item / Column in Expression 1 = Expression 2P1_PROBLEM_CODEN10

                       

                      As an aside, there's also a problem with garbled attributes on the P1_ORG_POST_CODE item:

                       

                      <input type="text" id="P1_ORG_POST_CODE" name="p_t33" class="text_field apex-page-item-error" onkeyup="this.value = this.value.toUpperCase()" ,style="�font-weight:100�,tabindex=&quot;3&quot;" ;="" tabindex="25" value="" size="8" maxlength="4000">
                      
                      
                      
                      
                      1 person found this helpful
                      • 23. Re: Re: Field focus after validation error
                        HRSysAdmin

                        Fantastic! What a silly mistake. I am very new to this and have a lot to learn.

                         

                        Thank you very much for your assistance.

                        • 24. Re: Field focus after validation error
                          fac586

                          HRSysAdmin wrote:

                           

                          Fantastic! What a silly mistake. I am very new to this and have a lot to learn.

                           

                          Thank you very much for your assistance.

                          No problem. I've been working with APEX for 10 years and I think that's the first time I've used the Conditional Validations utility, so I'm also still learning.

                           

                          You should edit your post above and remove your email address so it won't be picked up by spambots. When sharing apps on an apex.oracle.com workspace, you should not use email addresses as usernames. Create a guest developer account without workspace admin privileges, make that the one that is publicly available, and lock it after the problem is solved.

                          1 2 Previous Next