jQuery手機選擇菜單,表格計算器在瀏覽器Firefox中工作,但不是在Android中。當在瀏覽器中按下提交按鈕時,它按預期工作,但是當我在android中執行時,微調器會加載併發送回我的主頁。jquery手機選擇輸入
<form id="thermalgrowth">
<div data-role="fieldcontain">
<fieldset data-role="controlgroup">
<label for="t">
T:
</label>
<input id="t" placeholder="" name="t" value="" type="number" step="0.001" min="0"/>
</fieldset>
</div>
<div data-role="fieldcontain">
<fieldset data-role="controlgroup">
<label for="l">
L:
</label>
<input id="l" placeholder="" name="l" value="" type="number" step="0.001" min="0"/>
</fieldset>
</div>
<div data-role="fieldcontain">
<label for="c" class="select">C:</label>
<select name="c" id="c" >
<option value=".000006">Carbon Steel</option>
<option value=".0000059">Cast Iron</option>
<option value=".0000095">Stainless Steel</option>
<option value=".0000073">Nickel Steel</option>
<option value=".00001">Bronze</option>
</select>
</div>
<div class="ui-grid-a">
<div class="ui-block-a"><button id="reset" type="reset" data-theme="c" name="reset">Reset</button></div>
<div class="ui-block-b"><button id="submit" type="submit" data-theme="b" name="submit" >Submit</button></div>
</div>
<div data-role="fieldcontain">
<fieldset data-role="controlgroup">
<label for="tg">
Thermal Growth
</label>
<input id="tg" placeholder="" name="tg" type="number" disabled="disabled"/>
</fieldset>
</div>
<script type="text/javascript"><!--
function calculate() {
var t = $('#t').val();
var l = $('#l').val();
var c = $('#c').val();
var tg = Number(t) * l * c ;
$('#tg').val(tg.toFixed(3));
// submit event functions must return false,
// to tell the browser not to load a new page.
return false;
}
$('#thermalgrowth').submit(calculate);
$('#reset').click(function() {
$('#t').val('0').number('refresh');
$('#l').val('0').number('refresh');
$('#tg').val('0').number('refresh');
});
</script>
</form>
更改的變種TG =號(T)*數目(L)*數(c);並沒有注意到<! - 在之前的版本中,但無論如何都被刪除了,並且像魅力一樣工作。 – catalano