POC: Client-side form validation
-------------------------------- Key: OFBIZ-1559 URL: https://issues.apache.org/jira/browse/OFBIZ-1559 Project: OFBiz Issue Type: New Feature Components: framework Affects Versions: SVN trunk Reporter: Scott Gray Priority: Minor Proof of concept for using a client side form validation library with the form widget. If a form widget field has required-field="true" then the can't submit the form until they enter something in that field. I used JSValidate (http://www.jsvalidate.com/) as the library, but I couldn't find any license info on their site (I googled "site:jsvalidate.com license") -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. |
[ https://issues.apache.org/jira/browse/OFBIZ-1559?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Scott Gray updated OFBIZ-1559: ------------------------------ Attachment: validation.patch Not intended to be committed, just a POC. I've included the required javascripts in the GlobalDecorator so that it can be tested anywhere. No changes are required to existing form widgets Couple of issues: 1. The error message that gets displayed to the user ends up between the input and anything next to the input ie. a lookup or an * 2. The error messages need to be internationalized > POC: Client-side form validation > -------------------------------- > > Key: OFBIZ-1559 > URL: https://issues.apache.org/jira/browse/OFBIZ-1559 > Project: OFBiz > Issue Type: New Feature > Components: framework > Affects Versions: SVN trunk > Reporter: Scott Gray > Priority: Minor > Attachments: validation.patch > > > Proof of concept for using a client side form validation library with the form widget. > If a form widget field has required-field="true" then the can't submit the form until they enter something in that field. > I used JSValidate (http://www.jsvalidate.com/) as the library, but I couldn't find any license info on their site (I googled "site:jsvalidate.com license") -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. |
In reply to this post by Nicolas Malin (Jira)
[ https://issues.apache.org/jira/browse/OFBIZ-1559?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12555821#action_12555821 ] Scott Gray commented on OFBIZ-1559: ----------------------------------- Ok turns out not that many form fields have field-required="true" Here's one that this will work with: https://localhost:8443/accounting/control/newInvoice Also the library doesn't seem to like forms that don't have either a name or an id, but that can be fixed easily enough > POC: Client-side form validation > -------------------------------- > > Key: OFBIZ-1559 > URL: https://issues.apache.org/jira/browse/OFBIZ-1559 > Project: OFBiz > Issue Type: New Feature > Components: framework > Affects Versions: SVN trunk > Reporter: Scott Gray > Priority: Minor > Attachments: validation.patch > > > Proof of concept for using a client side form validation library with the form widget. > If a form widget field has required-field="true" then the can't submit the form until they enter something in that field. > I used JSValidate (http://www.jsvalidate.com/) as the library, but I couldn't find any license info on their site (I googled "site:jsvalidate.com license") -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. |
In reply to this post by Nicolas Malin (Jira)
[ https://issues.apache.org/jira/browse/OFBIZ-1559?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12555891#action_12555891 ] Jacques Le Roux commented on OFBIZ-1559: ---------------------------------------- Interesting, I have sent a question about licencing... > POC: Client-side form validation > -------------------------------- > > Key: OFBIZ-1559 > URL: https://issues.apache.org/jira/browse/OFBIZ-1559 > Project: OFBiz > Issue Type: New Feature > Components: framework > Affects Versions: SVN trunk > Reporter: Scott Gray > Priority: Minor > Attachments: validation.patch > > > Proof of concept for using a client side form validation library with the form widget. > If a form widget field has required-field="true" then the can't submit the form until they enter something in that field. > I used JSValidate (http://www.jsvalidate.com/) as the library, but I couldn't find any license info on their site (I googled "site:jsvalidate.com license") -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. |
In reply to this post by Nicolas Malin (Jira)
[ https://issues.apache.org/jira/browse/OFBIZ-1559?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Scott Gray updated OFBIZ-1559: ------------------------------ Attachment: validation.patch Improved version: 1. Fixed the problem with forms that don't have a name or an id, they just get skipped for validation 2. Moved the validation messages into the error message div that we use for server errors 3. Added timestamp validation to the form widget > POC: Client-side form validation > -------------------------------- > > Key: OFBIZ-1559 > URL: https://issues.apache.org/jira/browse/OFBIZ-1559 > Project: OFBiz > Issue Type: New Feature > Components: framework > Affects Versions: SVN trunk > Reporter: Scott Gray > Priority: Minor > Attachments: validation.patch, validation.patch > > > Proof of concept for using a client side form validation library with the form widget. > If a form widget field has required-field="true" then the can't submit the form until they enter something in that field. > I used JSValidate (http://www.jsvalidate.com/) as the library, but I couldn't find any license info on their site (I googled "site:jsvalidate.com license") -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. |
In reply to this post by Nicolas Malin (Jira)
[ https://issues.apache.org/jira/browse/OFBIZ-1559?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Scott Gray updated OFBIZ-1559: ------------------------------ Attachment: screenshot-1.jpg > POC: Client-side form validation > -------------------------------- > > Key: OFBIZ-1559 > URL: https://issues.apache.org/jira/browse/OFBIZ-1559 > Project: OFBiz > Issue Type: New Feature > Components: framework > Affects Versions: SVN trunk > Reporter: Scott Gray > Priority: Minor > Attachments: screenshot-1.jpg, validation.patch, validation.patch > > > Proof of concept for using a client side form validation library with the form widget. > If a form widget field has required-field="true" then the can't submit the form until they enter something in that field. > I used JSValidate (http://www.jsvalidate.com/) as the library, but I couldn't find any license info on their site (I googled "site:jsvalidate.com license") -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. |
Free forum by Nabble | Edit this page |