投稿者 メッセージ
<  PHPプログラミング  ~  addElementでラジオボタンが表示されない!
TAKU9874
投稿1時間: 金 1月 15, 2010 12:51 pm  引用



登録日: 2010年1月 15日
投稿記事: 1

初めての投稿です。皆様よろしくお願いいたします。

↓を利用して登録フォームを作りたいのですが・・・
require('HTML/QuickForm.php');
require('HTML/QuickForm/Renderer/ArraySmarty.php');
require('smarty/libs/Smarty.class.php');


addElementの年代部分のラジオボタンが表示されません。
スペルは合っていると思うのですが・・・
何故でしょうか? Crying or Very sad

add5.html---------------------------------------------------------------------
<form {$form.attributes} class="def">
{$form.hidden}{* ←FORM要素のhidden値 *}
{$form.javascript}{* ←入力値チェック用JSタグ *}
<dl>

↓が表示されません。何故? Crying or Very sad
<dt><span style=color:red>*</span>{$form.age.label}</dt><dd>{$form.age.html}</dd>



</dl>
</form>
--------------------------------------------------------------------------------
addd5.php---------------------------------------------------------------------
<?php

// 必要パッケージの読込み
require('HTML/QuickForm.php');
require('HTML/QuickForm/Renderer/ArraySmarty.php');
require('smarty/libs/Smarty.class.php');

// MySmartyクラスの定義
class MySmarty extends Smarty {
function MySmarty()
{
$this->Smarty();
$this->template_dir = "template/";
$this->compile_dir = "compile/";
}
}

// Form要素の構築
$form = new HTML_Quickform("name_test","get","add2.php");

// radio 要素を追加
$obj =& $form->addElement("radio", "age", "年代:", "10代", "10", array("checked"));
// デフォルトでチェックの設定にする
$obj->setChecked(TRUE);
$form->addElement("radio", "age", "", "20代", "20");
$form->addElement("radio", "age", "", "30代", "30");
$form->addElement("radio", "age", "", "40代", "40");

$smarty = new MySmarty();
$renderer =& new HTML_QuickForm_Renderer_ArraySmarty($smarty);
$form->accept($renderer);
$smarty->assign('form', $renderer->toArray());
$smarty->display("add5.html");
?>
--------------------------------------------------------------------------------
トップに移動
ユーザー情報を表示 メッセージを送信
特定期間内の記事を表示:   
All times are GMT +9:00

次のトピックを表示
前のトピックを表示
Page 1 of 1
フォーラム一覧  ~  PHPプログラミング

トピックの新規投稿   返信


 
移動先:  

新規投稿: 不可
返信: 不可t
自分の記事の編集: 不可
自分の記事の削除: 不可
投票への参加: 不可




Powered by phpBB
customized by phpspot.