Skip to content

Instantly share code, notes, and snippets.

@satomixx
Created January 30, 2014 11:54
Show Gist options
  • Save satomixx/8707000 to your computer and use it in GitHub Desktop.
Save satomixx/8707000 to your computer and use it in GitHub Desktop.
JavaScriptで、ブラウザデフォルトの確認ダイアログを使う方法 ref: http://qiita.com/mugyuu/items/4331bb6dedc2d76fc8e6
function confirmPugyaa(msg,target){
if(window.confirm(target + "さんに" + msg + "します。\nよろしいですか?\n")){
return true;
}else{
return false;
}
}
<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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment