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 : SelectListMultiple with form, 
                            callback method on change in AJAX

Tutorials

>

Tutorial Selectlist

>

Tutorial : SelectListMultiple with form, callback method on change in AJAX


Selectlist-07: Tutorial of the composant Selectlist of the PHP FrameWork WebSite-PHP.

Tutorial : SelectListMultiple with form, callback method on change in AJAX:




Go back to tutorial of the componant Selectlist



Source code

Source code


File: /pages/tutorials/selectlist/selectlist-07.php

 <?php
class Selectlist07 extends Page {
    public function 
InitializeComponent() {
        
parent::$PAGE_TITLE "Tutorial : SelectListMultiple with form, 
                            callback method on change in AJAX"
;
        
        
$form = new Form($this);
        
        
$this->selectlist = new SelectListMultiple($form);
        
$this->selectlist->setNbLines(6);
        
$this->selectlist->addItem("value1""value 1");
        
$this->selectlist->addItem("value2""value 2");
        
$this->selectlist->addItem("value3""value 3");
        
$this->selectlist->addItem("value4""value 4");
        
$this->selectlist->addItem("value5""value 5");
        
$this->selectlist->addItem("value6""value 6");
        
$this->selectlist->onChange("onChangeSelectList");
        
$this->selectlist->setAjaxEvent();
        
$this->selectlist->setStripTags();
        
        
$form->setContent($this->selectlist);
        
$this->render $form;
        
$this->render = new WSPObject($this->render"<br/>");
    }
    
    public function 
onChangeSelectList($sender) {
        
$dialog = new DialogBox("onChangeSelectList"
                        
implode(", "$this->selectlist->getValue()));
        
$this->addObject($dialog);
    }
}
?> 


Go back to tutorial of the componant Selectlist


Share

 


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