WebSite-PHP Framework PHP
Mehrsprachig
Einfacher Ajax Modus
Kein HTML, kein JavaScript
URL Rewriting
Mails senden
Sitemap - RSS - Web service
Laden Sie WebSite-PHP FrameWork jetzt herunter
 


Loading
 


Tutorial Textarea

Tutorials

>

Tutorial Textarea



Tutorial 1 : Simple TextArea
Datei: /pages/tutorials/textarea/textarea-01.php

<?php
class Textarea01 extends Page {
    public function 
InitializeComponent() {
        
parent::$PAGE_TITLE "Tutorial : Simple TextArea";
        
        
$this->render = new TextArea($this);
        
$this->render->setValue("Simple TextArea");
    }
}
?>


Tutorial 2 : Simple TextArea with auto height
Datei: /pages/tutorials/textarea/textarea-02.php

<?php
class Textarea02 extends Page {
    public function 
InitializeComponent() {
        
parent::$PAGE_TITLE "Tutorial : Simple TextArea with 
                                auto height"
;
        
        
$this->render = new TextArea($this);
        
$text "TextArea with\nauto height\nand carriage return\n";
        
$text .= "Write text in this area to try auto height !!!";
        
$this->render->setValue($text);
        
$this->render->setAutoHeight();
        
$this->render->setWidth(350);
    }
}
?>


Tutorial 3 : TextArea withLiveValidation
Datei: /pages/tutorials/textarea/textarea-03.php

<?php
class Textarea03 extends Page {
    public function 
InitializeComponent() {
        
parent::$PAGE_TITLE "Tutorial : TextArea with
                                LiveValidation"
;
        
        
$this->render = new Form($this);
        
        
$textarea = new TextArea($this->render);
        
$textarea->setValue("TextArea with LiveValidation");
        
$lv = new LiveValidation();
        
$lv->addValidatePresence();
        
$textarea->setLiveValidation($lv);
        
$textarea->setWidth(300);
        
        
$this->render->setContent($textarea);
    }
}
?>


Tutorial 4 : TextArea with onchange event
Datei: /pages/tutorials/textarea/textarea-04.php

<?php
class Textarea04 extends Page {
    public function 
InitializeComponent() {
        
parent::$PAGE_TITLE "Tutorial : TextArea with 
                            onchange event"
;
        
        
$this->render = new Form($this);
        
        
$this->textarea = new TextArea($this->render);
        
$this->textarea->setValue("TextArea with onchange event");
        
$this->textarea->setWidth(300);
        
$this->textarea->onChange("onChangeTextArea");
        
        
$this->render->setContent($this->textarea);
    }
    
    public function 
onChangeTextArea($sender) {
        
alert("TextArea value : ".$this->textarea->getValue());
    }
}
?>


Tutorial 5 : TextArea with height and width defined and no wrap text
Datei: /pages/tutorials/textarea/textarea-05.php

<?php
class Textarea05 extends Page {
    public function 
InitializeComponent() {
        
parent::$PAGE_TITLE "Tutorial : TextArea with height 
                            and width defined and no wrap text"
;
        
        
$this->render = new TextArea($this);
        
$text "TextArea with height\n";
        
$text .= "and width defined and no wrap text\n";
        
$text .= "This is a loooooooooooooooooonnnnnnnnnnnnnnnnnnnnnnnnnggggggggggggg string";
        
$this->render->setValue($text);
        
$this->render->noWrap()->setHeight(100)->setWidth(300);
    }
}
?>


Tutorial 6 : TextArea disabled
Datei: /pages/tutorials/textarea/textarea-06.php

<?php
class Textarea06 extends Page {
    public function 
InitializeComponent() {
        
parent::$PAGE_TITLE "Tutorial : TextArea disabled";
        
        
$this->render = new TextArea($this);
        
$this->render->setValue("TextArea disabled");
        
$this->render->disable();
    }
}
?>


Tutorial 7 : TextArea with PHP code editor
Datei: /pages/tutorials/textarea/textarea-07.php

<?php
class Textarea07 extends Page {
    public function 
InitializeComponent() {
        
parent::$PAGE_TITLE "Tutorial : TextArea with 
                                PHP code editor"
;
        
        
// Read PHP code of the current file
        
$code_file = new File(__FILE__);
        
$code $code_file->read();
        
$code_file->close();
        
        
// Create TextArea
        
$this->render = new TextArea($this);
        
$this->render->setValue($code);
        
$this->render->setWidth(550)->setHeight(300);
        
$this->render->activateSourceCodeEdit("php");
    }
}
?>



Share

 


Copyright © 2009-2024 WebSite-PHP Framework PHP
Start Dokumentation Herunterladen Schnellstart Tutorials Wiki Issue Tracker