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 Radiobutton

Tutorials

>

Tutorial Radiobutton



Tutorial 1 : Simple radio button
File: /pages/tutorials/radiobutton/radiobutton-01.php

<?php
class Radiobutton01 extends Page {
    public function 
InitializeComponent() {
        
parent::$PAGE_TITLE "Tutorial : Simple radio button";
        
        
$this->render = new WSPObject();
        
$radio = new RadioButtonGroup($this);
        
$radio->addRadioButton("My radio button");
        
$this->render->add($radio);
    }
}
?>


Tutorial 2 : 2 Radio buttons
File: /pages/tutorials/radiobutton/radiobutton-02.php

<?php
class Radiobutton02 extends Page {
    public function 
InitializeComponent() {
        
parent::$PAGE_TITLE "Tutorial : 2 Radio buttons";
        
        
$this->render = new WSPObject();
        
$radio = new RadioButtonGroup($this);
        
$radio->addRadioButton("Radio 1");
        
$radio->addRadioButton("Radio 2");
        
$radio->setValue("Radio 2"); // init selected radio
        
$this->render->add($radio);
    }
}
?>


Tutorial 3 : Radio button onchange event
File: /pages/tutorials/radiobutton/radiobutton-03.php

<?php
class Radiobutton03 extends Page {
    public function 
InitializeComponent() {
        
parent::$PAGE_TITLE "Tutorial : Radio button onchange event";
        
        
$this->render = new Form($this);
        
$radio = new RadioButtonGroup($this->render);
        
$radio->addRadioButton("Radio 1");
        
$radio->addRadioButton("Radio 2");
        
$radio->onChange("onChangeRadio");
        
$this->render->setContent($radio);
    }
    
    public function 
onChangeRadio($sender) {
        
alert("Radio value is ".$sender->getValue().".");
    }
}
?>


Tutorial 4 : 2 Radio buttons disabled
File: /pages/tutorials/radiobutton/radiobutton-04.php

<?php
class Radiobutton04 extends Page {
    public function 
InitializeComponent() {
        
parent::$PAGE_TITLE "Tutorial : 2 Radio buttons disabled";
        
        
$this->render = new WSPObject();
        
$radio = new RadioButtonGroup($this);
        
$radio->addRadioButton("Radio 1");
        
$radio->addRadioButton("Radio 2");
        
$radio->setValue("Radio 2"); // init selected radio
        
$radio->disable();
        
$this->render->add($radio);
    }
}
?>



Share

 


Copyright © 2009-2024 WebSite-PHP Framework PHP
Home Documentation Download Quick start Tutorials Wiki Issue Tracker