View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
04985 | Bug reports | Survey taking | public | 2011-02-28 23:56 | 2011-04-11 11:34 |
Reporter | tpartner | Assigned To | tpartner | ||
Priority | normal | Severity | partial_block | ||
Status | closed | Resolution | fixed | ||
Product Version | 1.91RC4 | ||||
Target Version | 1.91RC5 | Fixed in Version | 1.91RC6 | ||
Summary | 04985: Form submit firing twice | ||||
Description | An onclick function which includes an extra submit has been added to the "Next" button causing the submit function to fire twice when the button is clicked. This causes any warnings such as minimum answers to be alerted twice and the survey advances despite the requirements not being met. The function is submit_and_disable() in survey_runtime.js. Does anyone know why this function which includes an unecessary submit was added to the next button or have any reason not to remove it? See my attached patch. | ||||
Steps To Reproduce | Load up the attached survey which includes a mutiple-options question with "Minimum answeres" = 2. In group 1, do NOT answer the multi-opts and click next. The alert appears twice and the survey advances. | ||||
Tags | No tags attached. | ||||
Attached Files | double_submit_fix.patch (3,163 bytes)
Index: index.php =================================================================== --- index.php (revision 9836) +++ index.php (working copy) @@ -2905,24 +2905,24 @@ //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=' << " + $surveymover .= "<input class='submit' accesskey='p' type='button' onclick=\"javascript:document.limesurvey.move.value = 'moveprev'; $('#limesurvey').submit(); disable_navigator();\" value=' << " . $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")." >> ' 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")." >> ' 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")." >> ' name='move2' id=\"movenextbtn\" $disabled />\n"; } if (($_SESSION['step'] && ($_SESSION['step'] == $_SESSION['totalsteps']) && !$presentinggroupdescription) || $thissurvey['format'] == 'A') Index: scripts/survey_runtime.js =================================================================== --- scripts/survey_runtime.js (revision 9836) +++ scripts/survey_runtime.js (working copy) @@ -437,9 +437,8 @@ } } -function submit_and_disable() +function disable_navigator() { - $('#limesurvey').submit(); $('#navigator input').attr('disabled', 'disabled'); } | ||||
Bug heat | 2 | ||||
Complete LimeSurvey version number (& build) | 9836 | ||||
I will donate to the project if issue is resolved | No | ||||
Browser | FireFox | ||||
Database type & version | mySQL - 5.1.41 | ||||
Server OS (if known) | Win 7 | ||||
Webserver software & version (if known) | Apache - 2.2.14 | ||||
PHP Version | PHP - 5.3.1 | ||||
Date Modified | Username | Field | Change |
---|---|---|---|
2011-02-28 23:56 | tpartner | New Issue | |
2011-02-28 23:56 | tpartner | File Added: limesurvey_survey_51464.lss | |
2011-02-28 23:57 | tpartner | File Added: double_submit_fix.patch | |
2011-03-01 21:39 | tpartner | Assigned To | => tpartner |
2011-03-01 21:39 | tpartner | Status | new => assigned |
2011-03-01 21:39 | tpartner | Note Added: 14300 | |
2011-03-01 21:39 | tpartner | Status | assigned => resolved |
2011-03-01 21:39 | tpartner | Resolution | open => fixed |
2011-04-11 11:34 | c_schmitz | Fixed in Version | => 1.91RC6 |
2011-04-11 11:34 | c_schmitz | Status | resolved => closed |