자바 스크립트에서 여러 가지 시도를했지만 내 사이트에서 아무 것도 작동하지 않는 것 같습니다. 양식을 제출할 때 경고 팝업을 표시하려고합니다. 이것은 내가이 웹 사이트입니다웹 사이트에서 자바 스크립트 알림이 작동하지 않습니다.
<form>
Name:<br>
<input type="text" name="name" required><br>
Email:<br>
<input type="email" name="email" required><br>
Phone (Format: 999-999-9999):<br>
<input type="tel" name="phone" required pattern="\d{3}[\-]\d{3}[\-]\d{4}"><br>
Nature of comment:<br>
<input type="checkbox" name="comment" value="Question"> Question
<input type="checkbox" name="comment" value="Business Inquiry"> Business Inquiry
<input type="checkbox" name="comment" value="Comment"> Comment
<input type="checkbox" name="comment" value="Other"> Other <br>
Comment:<br>
<textarea></textarea><br>
<input type="submit" value="Submit">
<form onsubmit="return confirm('Do you really want to submit the form?');">
</form>
이 무엇을 : 당신은 거의 있었다 http://webpages.uncc.edu/~kjardine/MC_Portfolio/contact.html
상단 양식 요소에 onsubmit을 삽입 해보십시오. –
귀하의 HTML이 유효하지 않습니다. 양식 요소는 중첩되어서는 안되며 내부 양식에 닫는 태그가 없습니다. –
그게 다야! 고맙습니다! –