Form Controls error values
This is an open discussion with 13 replies, filed under Extensions.
Search
If you’re using the Form Controls utility to build your <label>
s, it should automatically append a class="invalid"
to the <label>
elements.
And if you’re not using Form Controls to also build the labels
, it’ll also add a class of invalid
to the form elements (inputs, select etc.) themselves.
At the moment there is no way of using the validation-summary
to get the error of a specific field, but it could be done with some messing around. But you might want to use vanilla XSLT to do that instead.
I guess if there is no validation on any fields nothing is gonna show really.. stupid (refering to myself) all I want is to append an invalid notification to the web address field.. as it has URL validation in the section field..
This is what I have but I see no validation error attached to the class of either labels or input:
<xsl:call-template name="form:label"> <xsl:with-param name="for" select="'title'"/> <xsl:with-param name="text" select="$labels/cymraeg-website-url"/> <xsl:with-param name="child"> <br /><xsl:value-of select="$labels/website-url-comment"/> <xsl:call-template name="form:input"> <xsl:with-param name="handle" select="'cymraeg-website-url'"/> </xsl:call-template> </xsl:with-param> </xsl:call-template>
Is the event definitely firing? If you post your form to ?debug
do you see the URL field validation and the event failure error message?
And have you set the form:event
variable with the correct event node?
Event node is data/event/advertise-a-job-with-template
And it is submitting cos I see it on the section entry once I’ve correctly posted the form.. haven’t checked debug for vaidation.. 2 secs..
here’s my xml
That doesn’t help really.. cos it’s not showing the html it produces..
here’s the html
And here is the xsl template for the page..
This is where I am building the form
Sorry should combine posts!
I see the error message in the form:validation summary
at the top of the page.. as well as this was hoping to be able to surround the field:select
that as an error with a red box.. at present the class of invalid is not being triggered.
I am facing the same issue. Seems that the class of invalid
does not work on select fields?
Sorry to confuse everyone. I should have ticked the "Make this a required field" option in my Section schema. Works like a charm now.
Create an account or sign in to comment.
Is there a way to have the error values surround the fields that are not valid with a red box, as we see within symphony itself when the xsl runs it’s validation?
Really like to have the error messages highlight/surround the actual label that has not validated?