我有一个简单的表单在网络上工作但是当谈到移动设备时,它不起作用。
function validateForm() {
var full_name = document.getElementById('full_name').value;
if (full_name == '') {
alert("Please enter your full name.");
return false;
}
}
<form method="post" id="event-form" onsubmit="return validateForm();">
<input type="text" name="full_name" id="full_name" >
<input type="submit" name="roles_reminder" value="submit" class="rolessubmit" id="rolessubmit">
</form>
演示