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 : Button callback method  
and display log in console and alert box

Tutorials

>

Tutorial Button

>

Tutorial : Button callback method and display log in console and alert box


Button-06: Tutorial of the composant Button of the PHP FrameWork WebSite-PHP.

Tutorial : Button callback method and display log in console and alert box:




Go back to tutorial of the componant Button



Source code

Source code


File: /pages/tutorials/button/button-06.php

<?php
class Button06 extends Page {
    private 
$text null;
    
    public function 
InitializeComponent() {
        
parent::$PAGE_TITLE "Tutorial : Button callback method  
                        and display log in console and alert box"
;
        
        
$form = new Form($this);
        
        
logConsoleInfo("This is an info");
        
logConsoleWarn("This is a warning");
        
logConsoleError("This is an error");
        
        
$this->text = new TextBox($form);
        
$this->text->setValue("Text to display in the console");
        
$this->text->setStripTags("<b><i>")->setWidth(200);
        
        
$button = new Button($form);
        
$button->setValue("Validate")->onClick("onClickButton");
        
$button->setAjaxEvent();
        
        
$form_obj = new Object($this->text"<br/>"$button);
        
$form_obj->setAlign(Object::ALIGN_CENTER);
        
        
$form->setContent($form_obj);
        
$this->render $form;
    }
    
    public function 
onClickButton($sender) {
        
alert($this->text->getValue());
        
logConsoleInfo($this->text->getValue());
    }
}
?>


Go back to tutorial of the componant Button


Share

 


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