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 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">&times;</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">&times;</span>
<span class="delete-option-icon">&times;</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">&times;</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>'
) )
} }
}) })