WebsiteBaker 2.13.8 is now available!
R.I.P Dietmar (luisehahne) and thank you for all your valuable work for WBhttps://forum.websitebaker.org/index.php/topic,32355.0.html
<?phprequire_once (WB_PATH.'/modules/x_cform/include.php');?>
<?php$form_attribs = Array ( 'name' => "wb_addresses_form", 'class' => "xForm", 'action' => $_SERVER['PHP_SELF']);$form = new c_form( $form_attribs );?>
<?php$form->addElement( Array ('type' => 'hidden', 'name' => "id", "value" => $_REQUEST['id']) );?>
<?php$form->addElement( Array ('type' => 'text', 'label'=> ucfirst($i), 'name' => $i, 'value' => $data[$i] ) );?>
<?php$form->addElement( Array ('type' => 'textarea', 'label'=> ucfirst($i), 'name' => $i, 'content' => $data[$i] ) );?>
<?php$content = array ( 'Anna' => 1, 'Judith' => 2, 'Mary Lou' => 3, 'Xanthippe' => 4}$form->addElement( Array ('type' => 'select', 'label' => ucfirst($i), 'name' => $i, 'content' => $group_select, 'select'=>3 ) );?>
<?php$form->addElement ( Array ('type' => 'submit', 'name' => 'submit', 'value' => $TEXT['SAVE'], 'onclick' => "this.submit();") );?>
<?php$form->addElement ( Array ( 'type' => 'select', 'name' => "group_id[]", 'label' => $ADDRESSES['DISPLAYGROUP'], 'content' => $group_select, 'select' => explode(",",$temp_data['groups']), // ! 'multiple' =>'multiple', 'size' => 4, 'onload' => "alert(this);") );?>
<?phpecho $form->toHTML();?>
Any kind of improvment, critics, recomentations, code-cleanings, warnings and grumbleare always wellcome.
<?php/** * @version 0.1.0 * @date 2008-09-16 * @author aldus * @package WebsiteBaker - code-examples * */$form_attribs = Array ( 'name' => "search", 'class' => "xForm", 'action'=> WB_URL."/search/index.php");$form = new c_form( $form_attribs );$form->addElement( Array ('type' => 'hidden', 'name' => "page_id", "value" => $page_id ) );$form->addElement( Array ('type' => 'hidden', 'name' => "section_id", "value" => $section_id ) );$form->addElement( Array ( 'type' => 'text', 'label' => "Suchbegriff: ", 'name' => "string", 'style' => "display:block;float:left;width:200px;" ));$form->addElement( Array('type' => 'html', 'content' => " ") );$form->addElement( Array ( 'type' => 'submit', 'name' => 'submit', 'value' => "Suchen", 'onclick' => "this.submit();", 'style' => "display:block;float:left;width:200px;" ));echo $form->toHTML();?>
Make a new Page, Type: "code2", and place the following inside (PHP)
What's a "formular"? Can someone please explain in a few sentences what this thingy is and does, without people having to install it first?Thanks.
$t = mktime( 0, 0, 0, $month, 1, 1, 2001);
<?php/** * Just a simple call within inside a code/code2 section * Please keep in mind, you don't have to include the module file here, as this one * is a code-snippet. * If you want to use it in the backend you will have to include it first, e.g. * require_once (WB_PATH."/modules/x_cForm/include.php"); * */ $form_args = array( 'method' => "post", 'action' => "#", 'class' => "my_example_form_class");$form = new c_form( $form_args );/** * Add a simple date-select * */$form->addElement( array( 'type' => "html", 'name' => "example", 'content' => $form->dateSelect(), 'label' => "example" ));/** * Add submit button * */$form->addElement ( array ( 'type' => 'submit', 'name' => 'submit', 'value' => $TEXT['SAVE'], 'onclick' => "this.submit();" ));echo $form->toHTML();unset( $form );
$form->addElement( Array ( 'type' => 'submit', 'name' => 'submit', 'value' => "Sichern", 'onclick' => "this.submit();", 'style' => "display:block;float:left;width:100px;" ) ); $form->addElement( Array ( 'type' => 'cancel', 'name' => 'cancel', 'value' => "Abbrechen", 'style' => "display:block;float:right;width:100px;" ) );
Can someone describe why to use this in stead of pmform?
Make a new Page, Type: "code2", and place the following inside (PHP)Code: [Select]<?php/** * @version 0.1.0 * @date 2008-09-16 * @author aldus * @package WebsiteBaker - code-examples * */code example doesnt work when place in code 2 and code 3. Help?$form_attribs = Array ( 'name' => "search", 'class' => "xForm", 'action'=> WB_URL."/search/index.php");$form = new c_form( $form_attribs );$form->addElement( Array ('type' => 'hidden', 'name' => "page_id", "value" => $page_id ) );$form->addElement( Array ('type' => 'hidden', 'name' => "section_id", "value" => $section_id ) );$form->addElement( Array ( 'type' => 'text', 'label' => "Suchbegriff: ", 'name' => "string", 'style' => "display:block;float:left;width:200px;" ));$form->addElement( Array('type' => 'html', 'content' => " ") );$form->addElement( Array ( 'type' => 'submit', 'name' => 'submit', 'value' => "Suchen", 'onclick' => "this.submit();", 'style' => "display:block;float:left;width:200px;" ));echo $form->toHTML();?>As for other working examples you can take a look at "addresses" ...RegardsAldus
<?php/** * @version 0.1.0 * @date 2008-09-16 * @author aldus * @package WebsiteBaker - code-examples * */code example doesnt work when place in code 2 and code 3. Help?$form_attribs = Array ( 'name' => "search", 'class' => "xForm", 'action'=> WB_URL."/search/index.php");$form = new c_form( $form_attribs );$form->addElement( Array ('type' => 'hidden', 'name' => "page_id", "value" => $page_id ) );$form->addElement( Array ('type' => 'hidden', 'name' => "section_id", "value" => $section_id ) );$form->addElement( Array ( 'type' => 'text', 'label' => "Suchbegriff: ", 'name' => "string", 'style' => "display:block;float:left;width:200px;" ));$form->addElement( Array('type' => 'html', 'content' => " ") );$form->addElement( Array ( 'type' => 'submit', 'name' => 'submit', 'value' => "Suchen", 'onclick' => "this.submit();", 'style' => "display:block;float:left;width:200px;" ));echo $form->toHTML();?>