我正在制作一个phonegap应用程序,我有一个页面,需要一些用户输入。如果复选框(报告)被选中,那么我想禁用除next check按钮之外的所有用户输入。
<div data-role="main" class="ui-content" id="MainBody">
<ul id="topBtns">
<li id="reportedLabel">
<label id="reportedLabel">
<input type="checkbox" id="reported" class="hidden" onchange="document.getElementById('1a').disabled = this.checked;document.getElementById('1b').disabled = this.checked;document.getElementById('comment1').disabled = this.checked;document.getElementById('photo1').disabled = this.checked;">
Already reported
</label>
</li>
<li id="back">
<button id="back" data-icon="arrow-l">
Check 0
</button>
</li>
</ul>
<br>
<h2 class="checkNum">Check #1</h2>
<p class="check">Some Text</p>
<label><input type="radio" id="1a" name="1">Answer1</label>
<label><input type="radio" id="1b" name="1">Answer2</label>
<br>
<textarea rows="4" placeholder="Type your comments here" id="comment1"></textarea>
<br>
<button id="photo1" onclick="insert_photo()">
Insert Photo
</button>
<button id="btnCont1" onClick="location.href='index.html#Q2'">Continue</button>
</div> <!-- Main -->
当我在这个问题中的代码片段上运行代码时,它可以工作,但是当我通过phonegap应用程序运行它,或者甚至只是运行HTML文件时,只有插入照片按钮被禁用,而其他3个元素被忽略。这让我认为这与Jquery Mobile有关,但我不确定是否完全诚实。
任何帮助都是非常感谢的。
https://stackoverflow.com/questions/51902991
复制相似问题