2013-12-11 6 views
0

i make return confirm from from post post method. Код работает, но мне нужно сфокусироваться Отмена при подтверждении. Но всегда хорошо сфокусировано. Как я решить этот вопросjavascript onclick cancel focus

мой код ниже ..

*

<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> 

*

+0

Я думаю, что у вас нет контроля над этим, вы можете использовать modalpopup insted и сфокусировать его –

+1

Вы не можете изменить поведение по умолчанию в диалоговом окне, создаваемом браузером. Вы можете создать свой собственный диалог подтверждения с помощью js и css. – bnuhero

ответ

0

Когда подтверждения, пришедшего с помощью этого

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