Uploaded image for project: 'HTML Form Entry Module'
  1. HTML Form Entry Module
  2. HTML-682

NumberFieldWidget’s checkNumber overrides existing CSS classes upon validation

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Should
    • Resolution: Fixed
    • Affects Version/s: HTML Form Entry 3.8.0
    • Fix Version/s: HTML Form Entry 3.9.2
    • Labels:
      None
    • Complexity:
      Low

      Description

      `checkNumber()` is an ad-hoc routine that goes with `NumberFieldWidget`.  

      The validations done by the function on Numeric concepts sets classes "legalValue" or "illegalValue" based on the entered value in these numeric fields.  The code which sets these classes replaces the already present classes for that field with the above mentioned classes.

      Here is the code which is responsible for the following behavior:

      https://github.com/openmrs/openmrs-module-htmlformentry/blob/4fbef121d8192e21eb4df7058dd511a69fb0612b/omod/src/main/webapp/resources/htmlFormEntry.js#L48-L54

      AC :

      The code should add these classes and keep the already present classes intact.

       

      Steps to Reproduce:

      1. Create a numeric concept.
      2. Add it using an obs tag in an htmlform. 
      3. Also add a custom css class to the obs tag.
      4. Once you enter the value in the field from the browser, the checkNumber() sets the class for the input field to "legalValue" or "IllegalValue" i.e. it overrides the already present class created in step 3.

       

       

        Gliffy Diagrams

          Attachments

            Activity

              People

              Assignee:
              sameermotwani11 Sameer Motwani
              Reporter:
              sameermotwani11 Sameer Motwani
              Designated Committer:
              Mark Goodrich
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - 4 hours
                  4h
                  Remaining:
                  Remaining Estimate - 4 hours
                  4h
                  Logged:
                  Time Spent - Not Specified
                  Not Specified