phpDocumentor SForm
Rules
[ class tree: SForm ] [ index: SForm ] [ all elements ]

Class: SForm_Rule_Maxlenth

Source Location: /SForm.php

Class SForm_Rule_Maxlenth

Class Overview

Set the maximum number of chars in a value

If this is added to a text input element, it will automatically set the 'maxlength' attribute unless it has already been set.

Located in /SForm.php [line 2575]

SForm_Rule
   |
   --SForm_Rule_Maxlenth

Properties

Methods

[ Top ]
Inherited Properties, Constants, and Methods
Inherited Properties Inherited Methods Inherited Constants

Inherited From SForm_Rule

SForm_Rule::$elements
SForm_Rule::$hasParent
SForm_Rule::$jsElmNum
SForm_Rule::$jsElmVar
SForm_Rule::$message
SForm_Rule::$validateOnClient

Inherited From SForm_Rule

SForm_Rule::__construct()
Construct a rule with one element and one error message
SForm_Rule::assignParent()
Mark this rule as having a parent
SForm_Rule::createJSRule()
Create a basic if-then rule in JavaScript
SForm_Rule::escClient()
Escape client side variables
SForm_Rule::genJSValue()
Returns JS to get a value and save it in the local variable
SForm_Rule::isError()
Returns true if this element(s) fail validation
SForm_Rule::toJavaScript()
Get the JavaScript that should be run onsubmit
SForm_Rule::toString()
Returns a message describing the error and its cause
SForm_Rule::validateOnClient()
Should we run validation code on the client

[ Top ]
Property Summary
integer   $maxlen   Max number of chars

[ Top ]
Method Summary
SForm_Rule_Maxlenth   __construct()   Setup client side checking
boolean   isError()   Is it too long?
void   toJavaScript()   Generate JavaScript to determine if the value is too long

[ Top ]
Properties
integer   $maxlen [line 2582]

Max number of chars

API Tags:
Access:  protected


[ Top ]
Methods
Constructor __construct  [line 2594]

  SForm_Rule_Maxlenth __construct( string $message, SForm_Element $element, integer $maxlen  )

Setup client side checking

If the element is a text input, we can enable client side checking with minimal overhead via the 'maxlength' attribute. Do so.

Parameters:
string   $message:  Error message
object Element   $element:  to check
integer   $maxlen:  Maximum number of chars


Redefinition of:
SForm_Rule::__construct()
Construct a rule with one element and one error message

[ Top ]
isError  [line 2622]

  boolean isError( )

Is it too long?


API Tags:
Return:  True if it's too long
Access:  public


Redefinition of:
SForm_Rule::isError()
Returns true if this element(s) fail validation

[ Top ]
toJavaScript  [line 2633]

  void toJavaScript( string 0  )

Generate JavaScript to determine if the value is too long

Returns the requested JavaScript validation code.

Parameters:
string   0:  JavaScript

API Tags:
Access:  public


Redefinition of:
SForm_Rule::toJavaScript()
Get the JavaScript that should be run onsubmit

[ Top ]

Documentation generated on Mon, 09 Apr 2007 19:08:50 -0500 by phpDocumentor 1.3.0