katAttack
Junior Member
Posts: 6
Registered: 6/3/2005
Member Is Offline
|
| posted on 6/3/2005 at 01:10 AM |
|
|
Custom Form Field Styles *saved* from destruction
I don't know how many of you find this 'feature' annoying but I did and I did something about it!
If you have a custom style assigned to fields and/or form elements being validated or used in the error 'label' function, these styles are promptly
destroyed by the validation process as tiagra applies its own:
Validation Okay style = "tfvNormal"
Validation Failed style = "tfvHighlight"
My form design included alternating colours for sections of the form which meant the default style was going to be insufficient as I wanted it to
return the fields/elements back to the class style they were.
I adapted the code to support the assignment of a tfvNormal and tfvHighlight style for each of the elements being defined in the validation
process:
e.g
'fSurname':{'l':'Last Name','r':true,'f':'alpha','t':'fSurname', 'c': 'classNormal', 'c2': 'classHighlight'}
c : Class name to use if field/label now okay
c2: Class name to use if field/label failed validation
If these aren't in the definition table the default tfv styles are used.
Useful to know the styles assigned may be more than one, eg
'c' : 'bigHead wideSpaced'
As per the CSS definition. Creative solution for an ugly problem.
|
|
|
|