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>
<input type="text" class="form-control option-label">
<span class="delete-option-icon">&times;</span>
</div>
` function addOption(type, container)
} else if (type === 'dropdown') { let optionHtml
optionHtml = `
<div class="option"> if (type === 'multiple-choice' || type === 'checkboxes') {
<input type="text" class="form-control option-label"> optionHtml = `
<span class="delete-option-icon">&times;</span> <div class="option">
</div> <input type="${type === 'multiple-choice' ? 'radio' : 'checkbox'}" disabled>
` <input type="text" class="form-control option-label">
}
container.append(optionHtml) <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() { 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>'
) )
} }
}) })