javascript onclick取消焦点

时间:2013-12-11 06:48:48

标签: javascript onclick confirm

我从动作发布方法返回确认..代码正在工作但我需要在确认到来时集中取消。但总是好的是专注。我如何解决这个问题

我的代码在下面..

*

<script type="text/javascript">
function confirmation() {
var consumption = document.getElementById("consumption").value;
var texthere1 = document.getElementById("texthere1").value;
var line = document.getElementById("texthere").value;
return confirm("You are about to issue Material <?php echo ltrim($data , "0") ;  ?> from 2100/<?php echo ($data2 ) ;  ?> To a Dying STO " + texthere1 + " At line " + line + " of " + consumption + " KG. Are You Sure ?")   ;  
return false;   
}
</script>
<form action="a.php" method="post">
<input name="Submit" type="submit" value="Submit" onclick="return confirmation()">
</form>

*

2 个答案:

答案 0 :(得分:0)

使用此确认时

document.getElementById('id').blur();

答案 1 :(得分:0)

我认为没有可能这样做,请看这篇类似的帖子:JavaScript: How to select "Cancel" by default in confirm box?