Skip to content

Commit

Permalink
Fix issue 04985: Form submit firing twice
Browse files Browse the repository at this point in the history
Dev Fixed multiple firing of submit function

git-svn-id: file:///Users/Shitiz/Downloads/lssvn/source/limesurvey@9839 b72ed6b6-b9f8-46b5-92b4-906544132732
  • Loading branch information
Tony Partner committed Mar 1, 2011
1 parent 8176fe3 commit fc4681f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
8 changes: 4 additions & 4 deletions index.php
Expand Up @@ -2905,24 +2905,24 @@ function surveymover()
//first step and we do not want to go back to the welcome screen since we don't show that...
//so skip the prev button
} else {
$surveymover .= "<input class='submit' accesskey='p' type='button' onclick=\"javascript:document.limesurvey.move.value = 'moveprev'; submit_and_disable();\" value=' &lt;&lt; "
$surveymover .= "<input class='submit' accesskey='p' type='button' onclick=\"javascript:document.limesurvey.move.value = 'moveprev'; $('#limesurvey').submit(); disable_navigator();\" value=' &lt;&lt; "
. $clang->gT("Previous")." ' name='move2' id='moveprevbtn' $disabled />\n";
}
}
if (isset($_SESSION['step']) && $_SESSION['step'] && (!$_SESSION['totalsteps'] || ($_SESSION['step'] < $_SESSION['totalsteps'])))
{
$surveymover .= "\t<input class='submit' type='submit' accesskey='n' onclick=\"javascript:document.limesurvey.move.value = 'movenext'; submit_and_disable();\" value=' "
$surveymover .= "\t<input class='submit' type='submit' accesskey='n' onclick=\"javascript:document.limesurvey.move.value = 'movenext'; disable_navigator();\" value=' "
. $clang->gT("Next")." &gt;&gt; ' name='move2' id='movenextbtn' $disabled />\n";
}
// here, in some lace, is where I must modify to turn the next button conditionable
if (!isset($_SESSION['step']) || !$_SESSION['step'])
{
$surveymover .= "\t<input class='submit' type='submit' accesskey='n' onclick=\"javascript:document.limesurvey.move.value = 'movenext'; submit_and_disable();\" value=' "
$surveymover .= "\t<input class='submit' type='submit' accesskey='n' onclick=\"javascript:document.limesurvey.move.value = 'movenext'; disable_navigator();\" value=' "
. $clang->gT("Next")." &gt;&gt; ' name='move2' id='movenextbtn' $disabled />\n";
}
if (isset($_SESSION['step']) && $_SESSION['step'] && ($_SESSION['step'] == $_SESSION['totalsteps']) && $presentinggroupdescription == "yes")
{
$surveymover .= "\t<input class='submit' type='submit' onclick=\"javascript:document.limesurvey.move.value = 'movenext'; submit_and_disable();\" value=' "
$surveymover .= "\t<input class='submit' type='submit' onclick=\"javascript:document.limesurvey.move.value = 'movenext'; disable_navigator();\" value=' "
. $clang->gT("Next")." &gt;&gt; ' name='move2' id=\"movenextbtn\" $disabled />\n";
}
if (($_SESSION['step'] && ($_SESSION['step'] == $_SESSION['totalsteps']) && !$presentinggroupdescription) || $thissurvey['format'] == 'A')
Expand Down
3 changes: 1 addition & 2 deletions scripts/survey_runtime.js
Expand Up @@ -437,9 +437,8 @@ function show_hide_group(group_id)
}
}

function submit_and_disable()
function disable_navigator()
{
$('#limesurvey').submit();
$('#navigator input').attr('disabled', 'disabled');
}

Expand Down

0 comments on commit fc4681f

Please sign in to comment.