장수 생성 시 종능 부족하면 경고창 띄움

This commit is contained in:
2018-08-23 01:07:25 +09:00
parent 668364e583
commit 888a76eda0
2 changed files with 11 additions and 1 deletions
+1 -1
View File
@@ -84,7 +84,7 @@ $nationList = $db->query('SELECT nation,`name`,color,scout,scoutmsg FROM nation
echo getInvitationList($nationList);
?>
<form name=form1 method=post action=join_post.php>
<form id='join_form' name=form1 method=post action=join_post.php>
<table align=center width=1000 class='tb_layout bg0'>
<tr>
<td colspan=3 align=center id=bg1>장수 생성</td>
+10
View File
@@ -163,4 +163,14 @@ jQuery(function($){
$charInfoText.html('');
}
});
$('#join_form').submit(function(){
var currentStatTotal = parseInt($leader.val()) + parseInt($power.val()) + parseInt($leader.val());
if(currentStatTotal < defaultStatTotal){
if(!confirm('현재 능력치 총합은 {0}으로, {1}보다 낮습니다. 장수 생성을 진행할까요?'.format(currentStatTotal, defaultStatTotal))){
return false;
}
}
return true;
});
});