戻る

フォーム

このサイトの仕様上、部品は目的の動作と異なることがあるので、ソースを活用してください。

ラベルとコントロールをセットにする

<div data-role="fieldcontain">
	<label for="name">名前</label>
	<input type="text" name="name" id="name" value="">
</div>

レジェンドとコントロールをセットにする

職業:
<div data-role="fieldcontain">
	<fieldset  data-role="controlgroup">
		<legend>職業:</legend>
		<input type="radio" name="occupation" id="oc1">
		<label for="oc1">学生</label>
		<input type="radio" name="occupation" id="oc2">
		<label for="oc2">主婦</label>
		<input type="radio" name="occupation" id="oc3">
		<label for="oc3">会社員</label>
		<input type="radio" name="occupation" id="oc4">
		<label for="oc4">自営業</label>
		<input type="radio" name="occupation" id="oc9">
		<label for="oc9">その他</label>
	</fieldset>
</div>

ラベルを非表示にする

<div data-role="fieldcontain">
	<label for="name" class="ui-hidden-accesible">名前:</label>
	<input type="text" name="name" id="name" value="">
</div>
<div data-role="fieldcontain" class="ui-hide-label">
	<label for="name">名前:</label>
	<input type="text" name="name" id="name" value="">
</div>

自動初期化を拒否する(1)―マークアップから設定する

<div>
	<label for="jqm">jQuery Mobileコントロール</label>
	<select name="jqm" id="jqm">
		<option value="n1">A</option>
		<option value="n2">B</option>
		<option value="n3">C</option>
	</select>
</div>
<div>
	<label for="native">ネイティブコントロール</label>
	<select name="native" id="native" data-role="none">
		<option value="n1">A</option>
		<option value="n2">B</option>
		<option value="n3">C</option>
	</select>
</div>

自動初期化を拒否する(2)―スクリプトから設定する

$(document).bind("mobileinit",function(){
	$.mobile.page.prototype.options.keepNative = ".native";
});
inserted by FC2 system