Targeting Fields with Period in Name

7 views
Skip to first unread message

Richard Herbert

unread,
May 28, 2012, 5:48:26 AM5/28/12
to valida...@googlegroups.com
I'm using John Whish's ColdBox interceptor adaptation of Brian Kotek's fine FormUtilities and VT works fine for the server-side validation but it failing on the client-side.

I'm guessing this is due to the fact that VT targets the input name attribute, as in name="user.username" and jQuery needs the period to be escaped with a double-backslash to be able to "see" it.

I've now found the clientfieldname attribute but that doesn't seem to help...

<property name="username" clientfieldname="username" desc="Username">
<rule type="required" contexts="*" failuremessage="A Username is required" />
</property>

...and...

<input id="username" name="user.username" type="text" />

Am I doing it wrong?

Richard

Richard Herbert

unread,
May 28, 2012, 6:19:29 AM5/28/12
to valida...@googlegroups.com
Okay, I've worked it out. I *was* doing it wrong! This works for me...

<property name="username" clientfieldname="user.username" desc="Username">
<rule type="required" contexts="*" failuremessage="A Username is required" />
</property>

...and...

<input id="user.username" name="user.username" type="text" />

Result!

Richard

John Whish

unread,
May 28, 2012, 6:25:56 AM5/28/12
to valida...@googlegroups.com
Hey Richard - stop trying to make out it's my fault! :D

On 28 May 2012 11:19, Richard Herbert <ric...@infoweb.co.uk> wrote:
Okay, I've worked it out. I *was* doing it wrong! This works for me...


On Monday, May 28, 2012 10:48:26 AM UTC+1, Richard Herbert wrote:
I'm using John Whish's ColdBox interceptor adaptation of Brian Kotek's fine FormUtilities and VT works fine for the server-side validation but it failing on the client-side.

I'm guessing this is due to the fact that VT targets the input name attribute, as in name="user.username" and jQuery needs the period to be escaped with a double-backslash to be able to "see" it.

I've now found the clientfieldname attribute but that doesn't seem to help...

<property name="username" clientfieldname="username" desc="Username">
<rule type="required" contexts="*" failuremessage="A Username is required" />
</property>

...and...

<input id="username" name="user.username" type="text" />

Am I doing it wrong?

Richard

--
You received this message because you are subscribed to the Google Groups "ValidateThis" group.
To view this discussion on the web visit https://groups.google.com/d/msg/validatethis/-/rOnKGgM0ouYJ.

To post to this group, send email to valida...@googlegroups.com.
To unsubscribe from this group, send email to validatethis...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/validatethis?hl=en.

Richard Herbert

unread,
May 28, 2012, 6:38:15 AM5/28/12
to valida...@googlegroups.com
Wot? I'm trying to give you exposure and credit :-)
To unsubscribe from this group, send email to validatethis+unsubscribe@googlegroups.com.

John Whish

unread,
May 28, 2012, 6:38:50 AM5/28/12
to valida...@googlegroups.com
Ah! - in that case - carry on :)

To view this discussion on the web visit https://groups.google.com/d/msg/validatethis/-/2_-fvwW8-1AJ.

To post to this group, send email to valida...@googlegroups.com.
To unsubscribe from this group, send email to validatethis...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages