Insight into eDir-CMS (Composed by Wing and EA) - 2

原创 2012年03月23日 15:57:59


Form Submit on Company Editor and Room Editor


company editing:


On the client side, there are drop-down list and check box in the form:


<form action="company_rec.php" method="post" id="form-company">
      <fieldset class="companyform">
        <input name="action" type="hidden" value="edit" />
        <input name="save" type="hidden" value="edit" />
        <input name="save" type="hidden" value="edit" />
        <input name="cmp_id" id="cmp_id" type="hidden" value="2" />
        <table border="0">
          <tr>
            <td valign="top"><label>Rooms</label></td>
            <td>
				<table border="0">
					<tr><th style="padding:0 5px;">Floor</th><th style="padding:0 5px;">Room</th></tr>
					<tr><td style="padding:0 5px;">
						<select name='floor_id' id='floor_id' style='min-width:50px'>
							<option value="">No floor</option>
							<option value='1' selected>G</option>
							<option value='2' >P</option>
							<option value='3' >3</option>
							<option value='4' >4</option>
							<option value='5' >5</option>
							<!--....-->
						</select>
						</td>
						<td style="padding:0 5px;">
							<select name='room_id' id='room_id' style='min-width:50px'>
								<option value="">No room</option>
								<option value='1' >01</option>
								<option value='2' >02</option>
								<!--....-->
							</select>
						</td>
					</tr>
				</table>
			</td>
          </tr>
          <tr>
            <td valign="top"><label>Name(English)</label></td>
            <td><input name="eng_name" size="30" type="text" value="" /></td>
          </tr>
          <tr>
            <td valign="top"><label>Name(Traditional Chinese)</label></td>
            <td><input name="chi_name"size="30" type="text" value="華" /></td>
          </tr>
          <tr>
            <td valign="top"><label>Description</label></td>
            <td><textarea name="descp" rows="8" cols="15" class="tinymce xhedit"><p>G樓105室  /  G/F Shop 105</p></textarea></td>
          </tr>
          <tr>
            <td valign="top"><label>Amt of Strokes of 1st Traditional Chinese Char</label></td>
            <td><input name="amt_stroke" class="inputbox" size="30" type="text" value="12" /></td>
          </tr>
          <tr>
            <td valign="top"><label>Name(Simplified Chinese)</label></td>
            <td><input name="schi_name" size="30" type="text" value="" /></td>
          </tr>
          <tr>
            <td valign="top"><label>Description(Simplified Chinese)</label></td>
            <td><textarea name="sdescp" rows="8" cols="15" class="tinymce xhedit"><p>G  Shop 105</p></textarea></td>
          </tr>
          <tr>
            <td valign="top"><label>Amt of Strokes of 1st Simplified Chinese Char</label></td>
            <td><input name="samt_stroke"size="30" type="text" value="6" /></td>
          </tr>
          <tr>
            <td valign="top"><label>是否啟用設備默認字體</label></td>
            <td>
				<select name="is_def_font">
					<option value="1">YES</option>
					<option value="0" selected>NO</option>
				</select>
			</td>
          </tr>		  
          
          <tr>
			<td style="border:0"> </td><td style="border:0">
				<button class="ui-button ui-widget ui-state-default ui-corner-all" onclick="document.getElementById('form-company').submit();">
					<span class="ui-icon ui-icon-disk"></span>Submit
				</button>
			</td>
		  </tr>
        </table>
      </fieldset>
    </form>

We would change the field for 'is_def_font' from SELECT to CHECK BOX:


<td>
	<input type="checkbox" value="1" name="is_def_font" class="checkbox"> <label for="cbdemo2">啟用</label>
</td>

And that won't cause any change on the server side code, here is a reference to check box in PHP.


http://note.ajneok.org/programing_note/php/php-get-checkbox/

http://www.html-form-guide.com/php-form/php-form-checkbox.html


On the server side, we still just use $_POST["is_def_font"] to get the string value from user submitting. Besides, plz note that, if the option of SELECT does not have value attribute set, the text will be got by PHP instead.





版权声明:本文为博主原创文章,未经博主允许不得转载。

相关文章推荐

Insight into eDir-CMS (Composed by Wing and EA) - 1

The first topic is about the output buffer of PHP, since I found intensive usage ofob_start() andob_...

[Activeden] slick full website template with cms and 2 skins 中文版

体系包含全部的模块,两个没有同的皮肤,深度链接,最值得等待的是包括高等PHP内容管理系统(后盾),这内里含有惊人的代价,不要错过。 下级PHP管理系统: 前台(预览变动):http://...

How to integrate Struts2 into Web Application and small sample//TODO Verify!!!

Maven: struts2的Login Sample  第一步,使用eclipse新建一个maven webapp工程,如下图所示:   点击next,选择webapp工程,然后...

Mapeasy update by wing_tang@msn.com

  • 2012年03月06日 01:46
  • 356KB
  • 下载

Wing FTP Server and Lua源码(含注册码)

  • 2014年01月01日 14:35
  • 7.75MB
  • 下载

Codeforces Round #259 (Div. 2)-B. Little Pony and Sort by Shift

B. Little Pony and Sort by Shift time limit per test 1 second memory limit per test 256 ...

JTAG - Insight into JTAG

What is JTAG? JTAG is an IEEE standard (1149.1) developed in the 1980s to solve electronic boards m...

Insight into Joomla! (preface)

So, as for my mission, it is to build up a website for a soccer league, and one of the requirements ...
内容举报
返回顶部
收藏助手
不良信息举报
您举报文章:Insight into eDir-CMS (Composed by Wing and EA) - 2
举报原因:
原因补充:

(最多只允许输入30个字)