Documentation
¶
Overview ¶
Package formx provides user-editable forms
Index ¶
- Constants
- func CheckboxAnswers(qna QuestionAnswer) string
- func Funcs(funcs template.FuncMap, policy *bluemonday.Policy) template.FuncMap
- func JoinSlice(slice []string) string
- func MultiradioAnswers(qna QuestionAnswer, subqna SubquestionAnswer) string
- func RadioSelectAnswers(qna QuestionAnswer) string
- func SanitizeHTML(policy *bluemonday.Policy) func(string) template.HTML
- type Answers
- type Option
- type Question
- type QuestionAnswer
- type Questions
- type Subquestion
- type SubquestionAnswer
Constants ¶
View Source
const ( QuestionTypeParagraph = "paragraph" QuestionTypeShorttext = "short text" QuestionTypeLongtext = "long text" QuestionTypeCheckbox = "checkbox" QuestionTypeSelect = "select" QuestionTypeRadio = "radio" QuestionTypeMultiradio = "multiradio" QuestionTypeDate = "date" QuestionTypeTime = "time" QuestionTypeImage = "image" QuestionTypeNull = "" )
Variables ¶
This section is empty.
Functions ¶
func CheckboxAnswers ¶
func CheckboxAnswers(qna QuestionAnswer) string
func MultiradioAnswers ¶
func MultiradioAnswers(qna QuestionAnswer, subqna SubquestionAnswer) string
func RadioSelectAnswers ¶
func RadioSelectAnswers(qna QuestionAnswer) string
func SanitizeHTML ¶
func SanitizeHTML(policy *bluemonday.Policy) func(string) template.HTML
Types ¶
type Question ¶
type Question struct { Type string `json:"Type"` Text string `json:"Text"` Name string `json:"Name"` Options []Option `json:"Options"` Subquestions []Subquestion `json:"Subquestions"` }
type QuestionAnswer ¶
type QuestionAnswer struct { Type string `json:"Type"` Text string `json:"Text"` Name string `json:"Name"` Options []Option `json:"Options"` SubquestionAnswers []SubquestionAnswer `json:"SubquestionAnswers"` Answer []string `json:"Answer"` }
func MergeQuestionsAnswers ¶
func MergeQuestionsAnswers(questions Questions, answers Answers) []QuestionAnswer
type Subquestion ¶
type SubquestionAnswer ¶
Click to show internal directories.
Click to hide internal directories.