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