* * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * */ /** * @file * @brief Test the HtmlInput object it means the Inum, IText , ... */ $http=new HttpInput(); ?>
    

Input_switch.class.php

Normal

        
    $input_switch=new InputSwitch('input_switch_value',get("input_switch_value","string","0")?>);
    echo $input_switch->input();
    
input_switch get("input_switch_value","string","0")); echo $input_switch->input(); ?>

ReadOnly

    $input_switch=new InputSwitch('input_switch_readonly',0);
    $input_switch->readOnly=TRUE;
    echo  $input_switch->input();
    
input_switch readOnly=TRUE; echo $input_switch->input(); ?>

EXPERIMENTAL InputCheckBox (Check Box)

Submit

        echo HtmlInput::submit("submit", _("Envoi"));
    

ICheckBox

For using range all the checkbox must have the same name , like checkbox[]

    id=uniqid(); $icheckbox->set_range("icheckbox11"); echo '
  1. '; printf ("%s ".$icheckbox->input(),$i); echo '
  2. '; } echo ICheckBox::javascript_set_range("icheckbox11"); ?>

Fichier - IFile

id="file_to_upload"; echo "fichier ",$file->input(); echo HtmlInput::submit("file","Upload"); ?>

Vérifier le changement de taille fichier dans la console JS

ICArd

Aucun param suppl.

input(); echo $icard->search(); ?>

itext

HTML Attribute

    $itext=new IText("itext_name");
    $itext->set_attribute("key1",1);
    $itext->set_attribute("data1","-data-");
    $itext->set_attribute("logx","data:logx");
    echo $itext->input();
     echo $itext->display();
style=' class="input_text" '; $itext->set_attribute("key1",1); $itext->set_attribute("data1","-data-"); $itext->set_attribute("logx","data:logx"); echo $itext->input(); echo $itext->display(); ?>
    input());?>
    display());?>

Maxlenght = 15

maxlength=15; $itext->style=' class="input_text" '; echo $itext->input(); echo $itext->display(); ?>
    input());?>
    display());?>

placeholder

style=' class="input_text" '; $itext->placeholder="Donnez une information"; echo $itext->input(); echo $itext->display(); ?>
    $itext->placeholder="Donnez une information";
    input());?>
    display());?>

require

style=' class="input_text" '; $itext->require=true; echo $itext->input(); echo $itext->display(); ?>
 $itext->require=true;
    input());?>
    display());?>

pattern : uniquement des chiffres

style=' class="input_text" '; $itext->pattern="[0-9]"; $itext->maxlength="4"; $itext->placeholder="9999"; $itext->title="code"; echo $itext->input(); echo $itext->display(); echo HtmlInput::submit("valider","valider"); ?>
    $itext->pattern="[0-9]";
    input());?>
    display());?>

IDATE

input(); echo htmlspecialchars($date->input()); $date->id= uniqid(); $date->javascript=sprintf('onchange = "console.debug(\'change date\');%s"',"format_date(this);"); echo $date->input(); ?>

ISELECT

Normal

value=array( ["value"=>1,"label"=>"Deer"], ["value"=>2,"label"=>"Dog"], ["value"=>3,"label"=>"Cat"], ["value"=>4,"label"=>"Shark"], ["value"=>5,"label"=>"Goldenfish"], ["value"=>6,"label"=>"Salmon"], ["value"=>7,"label"=>"Chicken"], ["value"=>8,"label"=>"Swallow"], ["value"=>9,"label"=>"Eagle"] ); $select->label="Animal"; echo $select->input(); ?>

8 (Swallow) is selected

input is selected=8; echo $select->input(); ?> display is display(); ?>

OPTGROUP

value=array( ["value"=>0,"label"=>"Aucun choix"], ["value"=>null,"label"=>"Mammal"], ["value"=>1,"label"=>"Deer"], ["value"=>2,"label"=>"Dog"], ["value"=>3,"label"=>"Cat"], ["value"=>null,"label"=>"END Mammal"], ["value"=>null,"label"=>"Fish"], ["value"=>4,"label"=>"Shark"], ["value"=>5,"label"=>"Goldenfish"], ["value"=>6,"label"=>"Salmon"], ["value"=>null,"label"=>"END Fish"], ["value"=>null,"label"=>"Bird"], ["value"=>7,"label"=>"Chicken"], ["value"=>8,"label"=>"Swallow"], ["value"=>9,"label"=>"Eagle"], ["value"=>null,"label"=>"END Bird"] ); $select->label="Animal"; echo $select->input(); ?>

5 (Goldenfish) is selected

input is selected=5; echo $select->input(); ?> display is display(); ?>