开发者

embed javascript function in html

I want to use a confirm box for user to check before submitting the form. I use the following form tag in my script:

<form action="delete.php" method="POST" target="_blank" onsubmit="return confirm(\"Are you sure you want to delete it from the database?\");">

But it i开发者_开发问答s not working, after I click "submit" button, the "delete.php" will be executed. Can anyone help me figure out where I went wrong? I wonder is it because this "confirm" function is some sort of inline style that I need to do some reference in the <head> tag? Thanks!


onsubmit="return confirm('Are you sure you want to delete it from the database?');"

Tested, and works. I don't think you can escape characters like that in tags.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜