1
0
Fork 0
mirror of https://github.com/Oreolek/ifhub.club.git synced 2024-06-16 23:00:51 +03:00
This commit is contained in:
Mzhelskiy Maxim 2014-02-11 15:43:48 +07:00
parent c41fdfc0e8
commit c3f11f1ce7
2 changed files with 8 additions and 1 deletions

View file

@ -183,6 +183,13 @@ class ActionAjax extends Action {
if (count($aAnswerItems)!=count($aAnswerIds)) {
return $this->EventErrorDebug();
}
/**
* Ограничение на максимальное число ответов
*/
if (count($aAnswerIds)>$oPoll->getCountAnswerMax()) {
$this->Message_AddErrorSingle('Максимум можно выбрать вариантов: '.$oPoll->getCountAnswerMax());
return;
}
}
/**

View file

@ -9,7 +9,7 @@
<h3 class="poll-title">{$oPoll->getTitle()}</h3>
{if ! $oPoll->getVoteCurrent()}
<form action="" method="post" class="js-poll-vote-form">
<form action="" method="post" class="js-poll-vote-form" onsubmit="return false;">
<ul class="poll-answer-list">
{foreach $oPoll->getAnswers() as $oAnswer}
<li class="poll-answer-list-item js-poll-answer-list-item" data-answer-id="{$oAnswer->getId()}">