ValidForm::Fieldset (Class)

In: ValidForm.rb
ValidForm_html.rb
Parent: Object

Represents a logical grouping of fields in a ValidForm. (In HTML, this would be represented by a <fieldset> element.) All fields in a form are placed into a fieldset; when fields are added directly to a form via ::Container#add_fields, an anonymous fieldset is created to hold them.

Methods

new   to_html  

Attributes

fields  [R]  An Array of every field added to this fieldset. See also ::Container#fieldsByName and ::Container#fieldById
form  [R]  The form that this fieldset is in. Use myForm.addFields( … ) to add a fieldset to a form. (See ::Container#add_fields).
id  [R]  The unique identifier for this fieldset.
label  [RW]  The human-friendly label for this fieldset. (Used for the <legend> in HTML)

Included Modules

Public Class methods

id:The unique identifier for this fieldset.
label:The human-friendly label for the fieldset.
attributes:A Hash of various custom attributes to be associated with the fieldset.
 contact = ValidForm.new('updatecontact.rbx','POST')
 phones  = ValidForm::Fieldset.new('phones','Phone Numbers')

 contact.add_fields( phones, ValidForm::Field.new('phone_home',nil,nil,'Home') )
 contact.add_fields( phones, ValidForm::Field.new('phone_work',nil,nil,'Work') )
 contact.add_fields( phones, ValidForm::Field.new('phone_cell',nil,nil,'Cell') )

Public Instance methods

withValidation:Boolean value to control whether the custom attributes for client-side validation (using FormAutoValidate) are included or not.
indentLevel:Number of tabs to indent the HTML code (for source code readability).

See ValidForm#to_html for a description on how to use (or ignore) the &block parameter.

[Validate]