Commit 9550d9c8 by Owen Ryan Ang

Changed implementation for 'others' field text box

parent 34b062f7
......@@ -509,7 +509,8 @@ const inputChecklist = (key, validation) => {
// Initially hide the input text box
var inputTextBox = document.createElement('input');
inputTextBox.type = 'text';
inputTextBox.id = 'dependentTB';
inputTextBox.id = `dependentTB_${key}`;
inputTextBox.classList.add('checkboxOther');
inputTextBox.style.display = 'none';
inputTextBox.style.padding = '0px';
dropdownContent.appendChild(inputTextBox);
......@@ -595,7 +596,8 @@ const inputRadiolist = (key, validation) => {
var inputTextBox = document.createElement('input');
inputTextBox.type = 'text';
inputTextBox.id = 'dependentTB';
inputTextBox.id = `dependentTB_${key}`;
inputTextBox.classList.add('radioOther');
inputTextBox.style.display = 'none';
inputTextBox.style.padding = '0px';
dropdownContent.appendChild(inputTextBox);
......
......@@ -21,7 +21,7 @@ export async function WriteForm(e,metrics,doctype,section) {
let fid = Nodes[i].id;
if (fid == 'DocType' || fid == 'Section' || fid == '' || fid == "submitButton") continue
// Skip the textbox in checklist and radiolist
if (fid == 'dependentTB' ) continue;
if (Nodes[i].classList.contains('radioOther') || Nodes[i].classList.contains('checkboxOther')) continue;
// Skip elements of type "button", "submit", and files
if (Nodes[i].type === 'button' || Nodes[i].type === 'submit' || fid == '' || Nodes[i].name === 'hidden_file_content') continue;
......
......@@ -22,7 +22,7 @@ export const submitForm = async (e) => {
const { id, value, type, name } = element
// Skip submit, buttons, and files
if (id === 'dependentTB' ) continue;
if (element.classList.contains('radioOther') || element.classList.contains('checkboxOther')) continue;
if (element.classList.contains('geotag') || element.classList.contains('altitude') || element.classList.contains('direction')) {
continue;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment