我想在输入元素本身中显示错误消息,而不是单独显示错误消息。我将如何捕获需要显示消息的元素?
这是代码:
function checkForm(form) {
if (yname.getValue() == "" || yname.getValue() == "Your Name" || name.getValue() == "" || name.getValue() == "Name of the Book" || url.getValue() == "" || url.getValue() == "URL of the Book"){
[id-of-the-element].setTextValue("Field cannot be empty!");
return false;
}