Re: FormTools :: List - validation on form

AJ Mercer <[email protected]>
Newsgroups gmane.comp.cms.farcry.devel
Message-ID <CAPURtC0yVmHH1zy8fkA0fyj97QX8y7Kmk0T=S=EDEvi9s-EzMA@mail.gmail.com>
this is doing the trick for me (so far)

not sure what this is all about
IIF(listLen(lData) eq tmpCount ,DE("
#arguments.stMetadata.ftClass#"),DE(""))IIF(listLen(lData) eq tmpCount
,DE(" #arguments.stMetadata.ftClass#"),DE(""))






<cfcase value="checkbox">
<cfsavecontent variable="html">
 <cfoutput>
<div class="multiField">
<cfset tmpCount=0>
<cfloop list="#lData#" index="i">
<cfset tmpCount=tmpCount + 1>
<cfif Left(i, 1) EQ ":">
<cfset optionValue = "" /><!--- This means that the developer wants the
value to be an empty string --->
<cfelse>
<cfset optionValue = ListFirst(i,":") />
</cfif>
<label>
<input type="checkbox" name="#arguments.fieldname#" class="checkboxInput
#arguments.stMetadata.ftClass#<!--- #IIF(listLen(lData) eq tmpCount ,DE("
#arguments.stMetadata.ftClass#"),DE(""))# --->" id="#arguments.fieldname#"
value="#optionValue#"<cfif listFindNoCase(arguments.stMetadata.value,
optionValue)> checked="checked"</cfif> />
<!--- <label class="fieldsectionlabel" class="fieldsectionlabel"
for="#arguments.fieldname#">#ListLast(i , ":")#</label> --->
<!--- MPS: styles aren't working so we are removing label for now until we
have time to look at the css --->
#ListLast(i , ":")#
<cfif arguments.stMetadata.ftMultipleLines><br class="fieldsectionbreak"
/></cfif>
</label />
</cfloop>
<input type="hidden" name="#arguments.fieldname#" value=""
class="#arguments.stMetadata.ftClass#">
</div>
</cfoutput>
 </cfsavecontent>
</cfcase>


On 21 May 2013 11:38, Blair McKenzie <[email protected]> wrote:

> It's probably a problem with the jquery plugin<http://docs.jquery.com/Plugins/Validation>we're using for validation not handling checkboxes / radio buttons well.
> I'm sure there's a custom validation rule we could write to do it, but we
> haven't gotten around to it.
>
> Blair
>
>
> On Tue, May 21, 2013 at 1:12 PM, AJ Mercer <[email protected]> wrote:
>
>> is there a reason why the list FormTool does not have validation?
>>
>> Or does it get it from field.cfc?
>>
>> My form is not failing when a list of checkboxes has none checked
>>
>>
>> <cfproperty name="advice" type="string" required="false"
>>  ftSeq="1" ftWizardStep="Advice"
>> ftFieldset="Area of Interest" ftLabel="I would like to know more about"
>>  ftType="list"
>> ftList="one:one,two:two"
>>  ftRenderType="checkbox"
>> ftValidation="required"
>>  >
>>
>>
>> --
>>
>> *AJ Mercer*
>> <webonix:net strength="Industrial" /> <http://webonix.net> | <webonix:org
>> community="Open" /> <http://webonix.org>
>> http://twitter.com/webonix
>> Railo Community Manager<http://www.getrailo.org/index.cfm/community/team/>
>>
>> --
>> You received this message cos you are subscribed to "farcry-dev" Google
>> group.
>> To post, email: farcry-dev-/[email protected]
>> To unsubscribe, email: farcry-dev+unsubscribe-/[email protected]
>> For more options: http://groups.google.com/group/farcry-dev
>> --------------------------------
>> Follow us on Twitter: http://twitter.com/farcry
>> ---
>> You received this message because you are subscribed to the Google Groups
>> "farcry-dev" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to farcry-dev+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/[email protected]
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>>
>>
>
>  --
> You received this message cos you are subscribed to "farcry-dev" Google
> group.
> To post, email: farcry-dev-/[email protected]
> To unsubscribe, email: farcry-dev+unsubscribe-/[email protected]
> For more options: http://groups.google.com/group/farcry-dev
> --------------------------------
> Follow us on Twitter: http://twitter.com/farcry
> ---
> You received this message because you are subscribed to the Google Groups
> "farcry-dev" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to farcry-dev+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/[email protected]
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>



-- 

*AJ Mercer*
<webonix:net strength="Industrial" /> <http://webonix.net> | <webonix:org
community="Open" /> <http://webonix.org>
http://twitter.com/webonix
Railo Community Manager <http://www.getrailo.org/index.cfm/community/team/>

-- 
You received this message cos you are subscribed to "farcry-dev" Google group.
To post, email: farcry-dev-/[email protected]
To unsubscribe, email: farcry-dev+unsubscribe-/[email protected]
For more options: http://groups.google.com/group/farcry-dev
--------------------------------
Follow us on Twitter: http://twitter.com/farcry
--- 
You received this message because you are subscribed to the Google Groups "farcry-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to farcry-dev+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/[email protected]
For more options, visit https://groups.google.com/groups/opt_out.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.