I added a couple AutoCompleteFields to a form using the method
mentioned in the last couple posts.  I have one field that is required
no matter what and that works fine, but I have another that uses the
RequiredIfMissing validator on the form schema.  That works fine if I'm
using the TextField, but I haven't figured out how to get it to work
with an AutoCompleteField.

Here is what I need:

class fields( w.WidgetsList ):
 # required all the time
  field1=w.AutocompleteField ( <snip>..,
   validator=v.Schema( text=v.NotEmpty(strip=True) )
 # checkbox
  cb=w.CheckBox()
 #field 2 required if box checkec
 field2 = w.AutoCompleteField ( <snip> ) # no validator

class mySchema ( v.Schema )
 chained_validators = [ v.RequiredIfMissing ( required='field2',
present='cb' )]

Well, if field2 is a TextField, then it can be present in the form, but
since it's changed to a CompoundWidget, it's inputs don't seem to be
available to the parent form.  I'm not sure if I can get the parents
fields in the child widget either.

Any Suggestions?

Thanks
Dennis


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"TurboGears" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/turbogears
-~----------~----~----~----~------~----~------~--~---

Reply via email to