Your commit message

This commit is contained in:
RameshT 2024-08-09 12:33:11 +05:30
parent 77d538cd26
commit 0505d21383
1 changed files with 26 additions and 22 deletions

View File

@ -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">&times;</span>
</div>
`
} else if (type === 'dropdown') {
optionHtml = `
<div class="option">
<input type="text" class="form-control option-label">
<span class="delete-option-icon">&times;</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">&times;</span>
</div>
`
} else if (type === 'dropdown') {
optionHtml = `
<div class="option">
<input type="text" class="form-control option-label">
<span class="delete-option-icon">&times;</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>'
)
}
})