/kunden/homepages/9/d13546020/htdocs/projekte/form/tests/form_textarea

form
        
          
Added in front of the closing form tag
callback() before validation... Validation results: submit Set by the custom validator. elname_textarea length_e
PHP Source <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">

<html>
<head>
    <title>Form Test</title>
</head>

<body>

  <?php
    
// whatever you need...
    
define("FORM_INCLUDE_DIR"$DOCUMENT_ROOT "/php/form/");
    
define("FILE"$DOCUMENT_ROOT "/projekte/form/tests/form_textarea");
  
    include_once(
FORM_INCLUDE_DIR "form.inc");
    include_once(
FORM_INCLUDE_DIR "form_xmlfactory.inc");
    
    function 
callback(&$form) {
      print 
"callback() before validation...";
      
$form->setValidationError("submit""Set by the custom validator.");
    }
    
    
$x = new form_xmlfactory(FILE ".xml");
  
?>
  <table cellspacing="2" cellpadding="4">
    <tr>
      <td align="left" valign="top" bgcolor="#C0C0C0" colspan="2"><h3><?php print FILE?></h3></td>
    </tr>
    <tr>
      <td align="left" valign="top">form</td>
      <td align="left" valign="top" >
        <pre>
        
          <?php
            $x
->Start();
            
$x->showElement("elname_textarea");
            
$x->showElement("submit");
            
$x->Finish();
            
$x->validate();
            
            print 
"\n\nValidation results:\n\n";
            list(
$allmsg$flags) = $x->getValidationResult();
            foreach (
$flags as $field => $msg)
              
printf("%15s %s\n"$field$msg);
          
?>
          
        </pre>
      </td>
    </tr>
    <tr>
      <td align="left" valign="top">PHP Source</td>
      <td  align="left" valign="top">
        <?php highlight_string(implode(""file(FILE ".php"))); ?>
      </td>
    </tr>
    <tr>
      <td align="left" valign="top">XML File</td>
      <td  align="left" valign="top">
        <pre>
          <?php print str_replace("\t""  "str_replace("<" "&lt;"implode(""file(FILE ".xml")))); ?>
        </pre>
      </td>
    </tr>
  
  </table>

</body>
</html>
XML File
          <?xml version="1.0" encoding="UTF-8"?>
<form jsname="dojs">

  <additionalhtml>
    Added in front of the closing form tag
  </additionalhtml>
  
  <javascript>
    <mode>strong</mode>
  </javascript>
  
  <defaults>
    <text size="1" maxlength="2"/>
    <file size="3"/>
    <image border="4"/>
    <intros errormsg = "Don't select me">
      <intro value="5">intro</intro>
    </intros>
    <css class="css class" id="id">style</css>
  </defaults>
  
  <elements nameprefix="elnp">
    
    <textarea name="name_textarea" elname="elname_textarea" rows="2" cols="20" wrap="virtual" readonly="false" frozen="false">
      textarea_value
      <css class="css class" id="id">style</css>
      <html accesskey="" tabindex="">additional html</html>   
      <validation>
        <length min="1" max="4">length_e</length>
        <regexp reg="[a-z]" icase="true">valid_e</regexp>
        <phpfunction callback="true">callback</phpfunction>
        <jsfunction>
          // must have the name of the (phpfunction)
          function callback(form) {
            // switch off length validaton 
            form.val_off("name_textarea", "l");
          }
        </jsfunction>
      </validation>
    </textarea>
    
     <submit name="submit" elname="submit" width="1" height="1" frozen="false" accesskey="" tabindex="">
      value
      <html accesskey="" tabindex="">additional html</html>   
      <css class="css class" id="id">style</css>
    </submit>
    
  </elements>
  
</form>