CodeIgniter PHP 單選框選中與不選中

來源:互聯網
上載者:User
啟用
停用

控制層那邊傳到頁面是status 裡面 1是啟用 2是停用,如果控制層傳過來是1 那麼就選中啟用相反,控制層傳過來是2 那麼就是停用。


我上面寫的沒有效果,求大蝦指點


回複討論(解決方案)

 checked="checked"  id="status" value="" />啟用 checked="checked"  value="" />停用

選不選中,應該設定checked 屬性的值。

 checked="checked"  id="status" value="" />啟用 checked="checked"  value="" />停用



A PHP Error was encountered

Severity: Notice

Message: Undefined variable: status

Filename: test/testadd.php

Line Number: 62

如果$status為空白的時候 怎麼會報錯,怎麼判斷一下為空白就誰都不選擇

我在做一個增加 修改 都同一個頁面

 />啟用             />停用

在模板裡寫php可以這樣寫

if (true) /**這裡寫代碼*/endif;


要不看到都是大括弧,很不好看。。。

在模板裡寫php可以這樣寫

if (true) /**這裡寫代碼*/endif;


要不看到都是大括弧,很不好看。。。
寫錯了,應該這樣:
if (true): /**這裡寫代碼*/endif;

選不選中,應該設定checked 屬性的值。





不好意思 分給錯人了,下次多給你一點,大蝦

  • 聯繫我們

    該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

    如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.