public
Created

JavaScriptで、ブラウザデフォルトの確認ダイアログを使う方法 ref: http://qiita.com/mugyuu/items/4331bb6dedc2d76fc8e6

  • Download Gist
confirm
1 2 3 4 5 6 7
function confirmPugyaa(msg,target){
if(window.confirm(target + "さんに" + msg + "します。\nよろしいですか?\n")){
return true;
}else{
return false;
}
}
form
1 2 3 4 5 6
<form action="[% path('/hoge/?i=request&target_id=' _ u.id) %]" method="POST" onSubmit="return confirmPugyaa('m9(^Д^)プギャー', '[% u.nickname %]')">
<input type="hidden" name="target_user_id" value="[% u.user_id %]" />
<div class="info">
<input type="submit" value="申請" class="send" />
</div>
</form>

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.