我正在制作一个 phonegap 应用程序,并且我有一个需要一些用户输入的页面。如果选中了一个复选框(报告),那么我想禁用除下一个检查按钮之外的所有用户输入。
<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 有关,但我不确定是否完全诚实。
任何帮助深表感谢