午夜国产狂喷潮在线观看|国产AⅤ精品一区二区久久|中文字幕AV中文字幕|国产看片高清在线

    dedecms自定義表單用js代替聯(lián)動類型解決聯(lián)動問題
    來源:易賢網(wǎng) 閱讀:872 次 日期:2016-06-18 09:25:56
    溫馨提示:易賢網(wǎng)小編為您整理了“dedecms自定義表單用js代替聯(lián)動類型解決聯(lián)動問題”,方便廣大網(wǎng)友查閱!

    最近用dedecms完成一個自定義表單,要用到地區(qū)的三級級聯(lián),地區(qū)肯定要使用option下拉框,如果讓人一個個填肯定不行,dedecms內(nèi)置的聯(lián)動類型被注釋掉了,網(wǎng)上有解決聯(lián)動類型的例子,但存在后臺信息的是枚舉,都是數(shù)字,不方便查看,網(wǎng)上的解決方案都不怎么完全,嘗試了一下沒有成功,自己便采取了比較取巧的方案,用js代替聯(lián)動類型

    自定義表單的字段的類型都使用單行文本,設(shè)置完之后前臺查看,并瀏覽器查看它的源文件。

    例如:

    代碼如下:

    <form action=/plus/diy.php enctype=multipart/form-data method=post>

    <input type=hidden name=action value=post />

    <input type=hidden name=diyid value=1 />

    <input type=hidden name=do value=2 />

    <table style=width:97%; cellpadding=0 cellspacing=1>

    <tr>

    <td align=right valign=top>省份:</td>

    <td><input type='text' name='province' id='province' style='width:250px' class='intxt' value='' />

    </td>

    </tr>

    <tr>

    <td align=right valign=top>地級市:</td>

    <td><input type='text' name='city' id='city' style='width:250px' class='intxt' value='' />

    </td>

    </tr>

    <tr>

    <td align=right valign=top>市、縣級市:</td>

    <td><input type='text' name='country' id='country' style='width:250px' class='intxt' value='' />

    </td>

    </tr>

    <input type=hidden name=dede_fields value=province,text;city,text;country,text />

    <input type=hidden name=dede_fieldshash value=652e45ca2c11e03bbe75d9f5ab1726ba /></table>

    <div align='center' style='height:30px;padding-top:10px;'>

    <input type=submit name=submit value=提 交 class='coolbg' />

    <input type=reset name=reset value=重 置 class='coolbg' />

    </div>

    </form>

    修改它的form表單,改成自己所需要的樣式,并將province,city,country都改成select的類型,三級級聯(lián)使用js完成

    如:

    代碼如下:

    <form action=/plus/diy.php enctype=multipart/form-data method=post>

    <input type=hidden name=action value=post />

    <input type=hidden name=diyid value=1 />

    <input type=hidden name=do value=2 />

    <select id=s_province name=province><option value=省份>省份</option></select>

    <select id=s_city name=city style=margin-left:20px;><option value=地級市>地級市</option></select>

    <select id=s_county name=country style=margin-left:20px;><option value=市、縣級市>市、縣級市</option></select>

    <script type=text/javascript src=js/area.js></script>

    <script type=text/javascript>_init_area();</script>

    <input type=hidden name=dede_fields value=province,text;city,text;country,text />

    <input type=hidden name=dede_fieldshash value=652e45ca2c11e03bbe75d9f5ab1726ba /></table>

    <div align='center' style='height:30px;padding-top:10px;'>

    <input type=submit name=submit value=提 交 class='coolbg' />

    <input type=reset name=reset value=重 置 class='coolbg' />

    </div>

    </form>

    更多信息請查看CMS教程
    由于各方面情況的不斷調(diào)整與變化,易賢網(wǎng)提供的所有考試信息和咨詢回復(fù)僅供參考,敬請考生以權(quán)威部門公布的正式信息和咨詢?yōu)闇?zhǔn)!
    相關(guān)閱讀CMS教程

    2025國考·省考課程試聽報名

    • 報班類型
    • 姓名
    • 手機(jī)號
    • 驗(yàn)證碼
    關(guān)于我們 | 聯(lián)系我們 | 人才招聘 | 網(wǎng)站聲明 | 網(wǎng)站幫助 | 非正式的簡要咨詢 | 簡要咨詢須知 | 新媒體/短視頻平臺 | 手機(jī)站點(diǎn) | 投訴建議
    工業(yè)和信息化部備案號:滇ICP備2023014141號-1 云南省教育廳備案號:云教ICP備0901021 滇公網(wǎng)安備53010202001879號 人力資源服務(wù)許可證:(云)人服證字(2023)第0102001523號
    云南網(wǎng)警備案專用圖標(biāo)
    聯(lián)系電話:0871-65099533/13759567129 獲取招聘考試信息及咨詢關(guān)注公眾號:hfpxwx
    咨詢QQ:1093837350(9:00—18:00)版權(quán)所有:易賢網(wǎng)
    云南網(wǎng)警報警專用圖標(biāo)