function display_form($name, $place, $choices) { printf("<form method=\"post\" action=\"%s\">\n", script_name()); hidden_field("name", $name); hidden_field("place", $place); hidden_field("choices", implode("#", $choices)); printf("Where was %s born?<br /><br />\n", htmlspecialchars($name)); for ($i = 0; $i < 5; $i++) { radio_button("response", $choices[$i], $choices[$i], FALSE); print "<br />\n"; } print "<br />\n"; submit_button("submit", "Submit"); print "</form>\n"; }
<label for="mail">郵便振替</label> </td> <td> ゆうちょ銀行から:<br /> 銀行:ゆうちょ銀行 記号:10290<br /> 番号:86685441 口座名:チーム二等辺三角形<br /> 他金融機関から:<br /> 銀行名:ゆうちょ銀行 店名:〇二八 店番:028<br /> 種目:普通預金 口座名:チーム二等辺三角形 </td> </tr> <tr> <td class="label"> <?php echo radio_button('payment_method', 'クレジットカード払い(Paypal払い)', array('id' => 'paypal')); ?> <label for="paypal">クレジットカード払い(Paypal払い)</label> </td> <td> Paypalのアカウントをお持ちでない方でも、ご利用いただけます。 </td> </tr> </table> <h4>アンケート(任意)</h4> <p> <label>職業</label><br /> <?php echo work_select_field(); ?>
public function testRadiobutton() { $this->assertDomEqual(radio_button('post', 'title', $this->post, 'PHP for ever'), '<input checked="checked" id="post_title_php_for_ever" name="post[title]" type="radio" value="PHP for ever" />'); $this->assertDomEqual(radio_button('post', 'title', $this->post, 'Hello World'), '<input id="post_title_hello_world" name="post[title]" type="radio" value="Hello World" />'); }
public function radio_button($method, $tagValue, $options = array()) { return radio_button($this->objectName, $method, $this->object, $tagValue, $options); }