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 with input text 
in form, callback method on click in AJAX

Tutorials

>

Tutorial Button

>

Tutorial : Button with input text in form, callback method on click in AJAX


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

Tutorial : Button with input text in form, callback method on click in AJAX:




Go back to tutorial of the componant Button



Source code

Source code


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

<?php
class Button05 extends Page {
    private 
$text null;
    
    public function 
InitializeComponent() {
        
parent::$PAGE_TITLE "Tutorial : Button with input text 
                    in form, callback method on click in AJAX"
;
        
        
$form = new Form($this);
        
        
$this->text = new TextBox($form);
        
$this->text->setValue("Enter your text");
        
$this->text->setStripTags("<b><i>");
        
        
$button = new Button($form);
        
$button->setValue("Validate")->onClick("onClickButton");
        
$button->setAjaxEvent();
        
        
$form_obj = new WSPObject($this->text"<br/>"$button);
        
        
$form->setContent($form_obj);
        
$this->render $form;
    }
    
    public function 
onClickButton($sender) {
        
$dialog = new DialogBox("onClickButton"
                        
$this->text->getValue());
        
$this->addObject($dialog);
    }
}
?>


Go back to tutorial of the componant Button


Share

 


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