Next Page

1

Previous Page

Thread: Save and add more to mulitple choice questions

Created on: 05/08/10 05:24 AM

Replies: 0

andyj


New Member


Joined: 05/11/05

Posts: 6

Save and add more to mulitple choice questions
05/08/10 5:24 AM

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 *

http://www.andyjarrett.co.uk

Link | Top | Bottom

Next Page

1

Previous Page

New Post

Please login to post a response.