WebSite-PHP Framework PHP
Multi language
Simple Ajax mode
No HTML, no JavaScript
URL rewriting
Mail sending
Sitemap - RSS - Web service
Download WebSite-PHP FrameWork now
 


Loading
 


Tutorial Checkbox

Tutorials

>

Tutorial Checkbox



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

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


Tutorial 2 : 2 CheckBox with one disabled
File: /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 WSPObject();
        
$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
File: /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
File: /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-2024 WebSite-PHP Framework PHP
Home Documentation Download Quick start Tutorials Wiki Issue Tracker