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 Radiobutton

Tutorials

>

Tutorial Radiobutton



Tutorial 1 : Simple radio button
Datei: /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
Datei: /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
Datei: /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
Datei: /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
Start Dokumentation Herunterladen Schnellstart Tutorials Wiki Issue Tracker