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 : Select an element on
a SelectList load values in a second SelectList

Tutorials

>

Tutorial Selectlist

>

Tutorial : Select an element on a SelectList load values in a second SelectList


Selectlist-06: Tutorial der Komponente Selectlist vom PHP FrameWork WebSite-PHP.

Tutorial : Select an element on a SelectList load values in a second SelectList:




Zurück zum Tutorial der Komponente Selectlist



Quelltext

Quelltext


Datei: /pages/tutorials/selectlist/selectlist-06.php

<?php
class Selectlist06 extends Page {
    public function 
InitializeComponent() {
        
parent::$PAGE_TITLE "Tutorial : Select an element on
                    a SelectList load values in a second SelectList"
;
        
        
$form = new Form($this);
        
        
$this->selectlist1 = new SelectList($form);
        
$this->selectlist1->setNbLines(3);
        
$this->selectlist1->addItem("value 1""value 1");
        
$this->selectlist1->addItem("value 2""value 2");
        
$this->selectlist1->addItem("value 3""value 3");
        
$this->selectlist1->addItem("value 4""value 4");
        
$this->selectlist1->addItem("value 5""value 5");
        
$this->selectlist1->addItem("value 6""value 6");
        
$this->selectlist1->onChange("onChangeSelectList");
        
$this->selectlist1->setAjaxEvent();
        
$this->selectlist1->setStripTags();
        
        
$this->selectlist2 = new SelectList($form);
        
$this->selectlist2->setNbLines(3);
        
$this->selectlist2->setStripTags();
        
        
$form->setContent(new Object($this->selectlist1
                                    
$this->selectlist2,
                                    
"<br/>"));
        
$this->render $form;
    }
    
    public function 
onChangeSelectList($sender) {
        
$this->selectlist2->removeItems();
        
$sel_value $this->selectlist1->getValue();
        
$this->selectlist2->addItem($sel_value."1"$sel_value."1");
        
$this->selectlist2->addItem($sel_value."2"$sel_value."2");
        
$this->selectlist2->addItem($sel_value."3"$sel_value."3");
    }
}
?>


Zurück zum Tutorial der Komponente Selectlist


Share

 


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