Your commit message
This commit is contained in:
parent
77d538cd26
commit
0505d21383
|
@ -2,28 +2,32 @@ $(document).ready(function () {
|
||||||
let index = 1
|
let index = 1
|
||||||
let activeSection = null
|
let activeSection = null
|
||||||
|
|
||||||
function addOption(type, container)
|
|
||||||
let optionHtml
|
|
||||||
|
|
||||||
if (type === 'multiple-choice' || type === 'checkboxes') {
|
|
||||||
optionHtml = `
|
|
||||||
<div class="option">
|
|
||||||
<input type="${type === 'multiple-choice' ? 'radio' : 'checkbox'}" disabled>
|
function addOption(type, container)
|
||||||
<input type="text" class="form-control option-label">
|
let optionHtml
|
||||||
|
|
||||||
<span class="delete-option-icon">×</span>
|
if (type === 'multiple-choice' || type === 'checkboxes') {
|
||||||
</div>
|
optionHtml = `
|
||||||
`
|
<div class="option">
|
||||||
} else if (type === 'dropdown') {
|
<input type="${type === 'multiple-choice' ? 'radio' : 'checkbox'}" disabled>
|
||||||
optionHtml = `
|
<input type="text" class="form-control option-label">
|
||||||
<div class="option">
|
|
||||||
<input type="text" class="form-control option-label">
|
<span class="delete-option-icon">×</span>
|
||||||
<span class="delete-option-icon">×</span>
|
</div>
|
||||||
</div>
|
`
|
||||||
`
|
} else if (type === 'dropdown') {
|
||||||
}
|
optionHtml = `
|
||||||
container.append(optionHtml)
|
<div class="option">
|
||||||
}
|
<input type="text" class="form-control option-label">
|
||||||
|
<span class="delete-option-icon">×</span>
|
||||||
|
</div>
|
||||||
|
`
|
||||||
|
}
|
||||||
|
container.append(optionHtml)
|
||||||
|
}
|
||||||
|
|
||||||
function createFormSection() {
|
function createFormSection() {
|
||||||
let newSection = `
|
let newSection = `
|
||||||
|
@ -96,7 +100,7 @@ $(document).ready(function () {
|
||||||
$(this)
|
$(this)
|
||||||
.closest('.form-section')
|
.closest('.form-section')
|
||||||
.append(
|
.append(
|
||||||
'<button class="btn btn-secondary add-option-btn">Add Option</button>'
|
'<button class="btn btn-secondary add-option-btn">Add Option</button>'
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in New Issue