From: RBRi <rb...@us...> - 2018-10-30 19:33:03
|
- **status**: pending --> closed --- ** [bugs:#1992] Error in validation of required fields** **Status:** closed **Group:** 2.33 **Created:** Wed Oct 10, 2018 03:00 PM UTC by Leonardo Silva Medina **Last Updated:** Tue Oct 30, 2018 07:32 PM UTC **Owner:** RBRi Hi !! I try to perform a test on a form and when clicking I do not do any event, the form has an elment of <input type="text" id="idUserRecupera" class="autoMayuscula sinTildes" autocomplete="off" required=""> to appear in the class /src/main/java/com/gargoylesoftware/htmlunit/html/HtmlForm.java => method public boolean isValid() { return !isRequiredSupported() || getAttributeDirect("required") == ATTRIBUTE_NOT_DEFINED || !getAttributeDirect("value").isEmpty(); } there is a method that validates the required fields, and I note that it has three validation criteria with a conditional || ( OR ), following the code for my case the condition (getAttributeDirect ("required") == ATTRIBUTE_NOT_DEFINED) this returns as FALSE result, but observed in more detail I see that it should be true since, getAttributeDirect ("required") = "" ATTRIBUTE_NOT_DEFINED = "", change it to getAttributeDirect ("required"). equals (ATTRIBUTE_NOT_DEFINED) and return the result that should be TRUE, in my opinion it is the indicated comparison to determine if the values are the same. public boolean isValid() { return !isRequiredSupported() || getAttributeDirect ("required"). equals (ATTRIBUTE_NOT_DEFINED) || !getAttributeDirect("value").isEmpty(); } --- Sent from sourceforge.net because htm...@li... is subscribed to https://sourceforge.net/p/htmlunit/bugs/ To unsubscribe from further messages, a project admin can change settings at https://sourceforge.net/p/htmlunit/admin/bugs/options. Or, if this is a mailing list, you can unsubscribe from the mailing list. |