I have added a "Save and Add more" button to the multiple choice question in handlers/multiplechoice/edit.cfm
Around line 226 I added the new button
<input type="submit" name="saveaddmore" value="Save and add more">
Around line 46 I've added a check for the form.saveaddmore button
<cfif isDefined("form.save") OR isDefined("form.saveaddmore")>And I've changed the block of code from around 126 - 133 to
<cfif not isDefined("attributes.question")>
<cfset attributes.question.id = application.question.addQuestion(form.question, form.rank, form.required, attributes.surveyidfk, attributes.questionType.id,answers)>
<cfelse>
<cfset application.question.updateQuestion(attributes.question.id,form.question, form.rank, form.required, attributes.surveyidfk, attributes.questiontype.id,answers)>
</cfif>
<cfset msg = "Your question has been saved.">
<cfif isDefined("form.save")>
<cflocation url="questions.cfm?surveyidfk=#attributes.surveyidfk#&msg=#urlEncodedFormat(msg)#" addToken="false">
<cfelseif isDefined("form.saveaddmore")>
<cflocation url="questions_edit.cfm?surveyidfk=#attributes.surveyidfk#&id=#attributes.question.id#" addToken="false">
</cfif>
Just wanted to share incase its useful to anyone else.
Andy Jarrett
* Last updated by: andyj on 5/8/2010 @ 5:25 AM *
