implement required fields on forms

Ticket

+commit
 

 

Current thinking:

 

  • New setting named "*required"
  • Rule is pointer referring to list of "field names".
  • Saving won't validate unless card is "present" (existent/not blank)
  • more sophisticated checks (eg valid email, number within range, etc will for now be done in modules)
  • validation for now is just ruby but may soon also be in javascript
  • special css class for all required fields

eg, 

 

type: Company

rule: Company+*type+*required:  [ address, contact ]

 

then: company won't save without +address and +contact

 

 

I'm not super excited about this because it's kind of limited, but I'm not sure how much further we could go for wagneers without introducing a LOT more complexity.

--Ethan McCutchen.....2013-11-04 20:03:37 +0000

I will say that I think that while "required" may be a quality of the left card (eg the company in this example), other validations are likely to be properties of the plus card. Eg, let's say that a company requires a valid email. The requirement itself is a quality of the company card. The validity of the email is a quality of the email card.

--Ethan McCutchen.....2013-11-04 20:07:25 +0000

(Stream of consciousness). You could make the case that this could be just one setting, like "*valid". Structured cards would work as describe above. Other cards could have lists of optional validations appropriate to their type / set. Hmm.

 

Current leaning: change *required to *require (more consistent with verbs for permission validations and would work with this proposal).

--Ethan McCutchen.....2013-11-04 20:14:16 +0000