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 Checkbox

Tutorials

>

Tutorial Checkbox



Tutorial 1 : Simple CheckBox
Datei: /pages/tutorials/checkbox/checkbox-01.php

<?php
class Checkbox01 extends Page {
    public function 
InitializeComponent() {
        
parent::$PAGE_TITLE "Tutorial : Simple CheckBox";
        
        
$this->render = new Object();
        
$chk1 = new CheckBox($this);
        
$chk1->setText("My CheckBox")->setChecked();
        
$this->render->add($chk1);
    }
}
?>


Tutorial 2 : 2 CheckBox with one disabled
Datei: /pages/tutorials/checkbox/checkbox-02.php

<?php
class Checkbox02 extends Page {
    public function 
InitializeComponent() {
        
parent::$PAGE_TITLE "Tutorial : 2 CheckBox with one 
                                disabled"
;
        
        
$this->render = new Object();
        
$chk1 = new CheckBox($this);
        
$chk1->setText("CheckBox 1")->setChecked();
        
$chk2 = new CheckBox($this);
        
$chk2->setText("CheckBox 2")->disable();
        
$this->render->add($chk1$chk2);
    }
}
?>


Tutorial 3 : CheckBox onchange event
Datei: /pages/tutorials/checkbox/checkbox-03.php

<?php
class Checkbox03 extends Page {
    public function 
InitializeComponent() {
        
parent::$PAGE_TITLE "Tutorial : CheckBox onchange event";
        
        
$this->render = new Form($this);
        
$chk1 = new CheckBox($this->render);
        
$chk1->setText("CheckBox 1");
        
$chk1->onChange("onChangeChk1");
        
$this->render->setContent($chk1);
    }
    
    public function 
onChangeChk1($sender) {
        
alert("CheckBox is ".(!$sender->isChecked()?"not ":"").
                
"checked.");
    }
}
?>


Tutorial 4 : CheckBox onchange Ajax event with a personal waiting message
Datei: /pages/tutorials/checkbox/checkbox-04.php

<?php
class Checkbox04 extends Page {
    public function 
InitializeComponent() {
        
parent::$PAGE_TITLE "Tutorial : CheckBox onchange Ajax event
                    with a personal waiting message"
;
        
        
$this->render = new Form($this);
        
$chk1 = new CheckBox($this->render);
        
$chk1->setText("CheckBox 1");
        
$chk1->onChange("onChangeChk1");

        
$chk1->setAjaxEvent();
        
$chk1->setAjaxWaitMessage("My personal waiting message");

        
$this->render->setContent($chk1);
    }
    
    public function 
onChangeChk1($sender) {
        
alert("CheckBox is ".(!$sender->isChecked()?"not ":"").
                
"checked.");
    }
}
?>



Share

 


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