일부 데이터를 입력하고 스크립트에서 물건을 처리하는 데 사용할 수있는 간단한 스프레드 시트 용 HTML 양식이 있습니다. 이제는 HTML 파일에 약간의 디자인 조정을하고 다른 이유로는 더 이상 작동하지 않는 것 같습니다 (버튼이 응답하지 않거나 함수를 호출하지 않음). 첫 번째 버전은 작동하지만 두 번째 버전은 작동하지 않습니다.HTML 디자인이 특정 디자인에서 응답하지 않습니다
- 어떻게하면 HTML 파일에서 문제가 발생하는지 가장 잘 해결할 수 있습니다. - 당신은 그것의 스타일을 제어하기 위해 다른
div
으로 버튼을 포장 만에 한:
<!DOCTYPE html> <html> <head> <base target="_top"> </head> <br> <script> function myFunction() { var date = new Date(); document.getElementById('date').placeholder = date.toLocaleDateString(); } </script> <body onload= "myFunction()"> <div align="center"> <form> Project Name <font color=red>*</font>:<br> <input type="text" name="pName"> <br> <br> Project Owner <font color=red>*</font>:<br> <input type="text" name="pOwner"> <br> <br> Sheet Responsible:<br> <input type="text" name="pResp"> <br> <br> Starting Time:<br> <input type="text" name="pDate" id="date"> <br> <br><br> <input type="button" value="Create" onclick="google.script.run .withSuccessHandler(google.script.host.close) .createSheet(this.parentNode)" /> </form> </div> </body> </html> ----------------------------------------------------------------------------------------------------- <!DOCTYPE html> <html> <style> div { margin: auto; width: 40%; font-family: Arial; } div.button { text-align: center; } input[type=text] { width: 100%; } </style> <script> function myFunction() { var date = new Date(); document.getElementById('date').placeholder = date.toLocaleDateString(); } </script> <head> <base target="_top"> </head> <br> <body onload="myFunction()"> <div> <form> Project Name <font color=red>*</font>:<br> <input type="text" name="pName"> <br> <br>Project Owner <font color=red>*</font>:<br> <input type="text" name="pOwner"> <br> <br>Sheet Responsible:<br> <input type="text" name="pResp"> <br> <br>Starting Time:<br> <input type="text" name="pDate" id="date"> <br> <br> <div class="button"> <br> <input type="button" value="Create" onclick="google.script.run .withSuccessHandler(google.script.host.close) .createSheet(this.parentNode)" /> </div> </form> </div> </body> </html>
'.createSheet (this.parentNode.parentNode)'시도 두 번째'parentNode'를 추가하십시오. –