#What is Symbol.iterator?
1 messages · Page 1 of 1 (latest)
if (result.canceled) return;
show your code
const res = {}
const [a,b] = res.formValues
Program Output
/home/jail/prog.js:2
const [a,b] = res.formValues
^
TypeError: undefined is not iterable (cannot read property Symbol(Symbol.iterator))
at Object.<anonymous> (/home/jail/prog.js:2:15)
at Module._compile (node:internal/modules/c
rememberm9#0000 | javascript | nodejs-16.14.0 | wandbox.org
const form = new FantasyWorldUI.ModalFormData()
form.title("FreeChatRankTicket")
form.textField("textField)
form.show(player).then(({ formValues }) => {
const [ FreeChatRank ] = formValues;
if (formValues.canceled) return;
player.runCommandAsync(`tag @s add "ListChatRank:${FreeChatRank}"`)
})
}``` code
if (!formValues) return;
const [ FreeChatRank ] = formValues;
same 😦
dont destructure formValues
okay
show ur code
const form = new FantasyWorldUI.ModalFormData()
form.title("FreeChatRankTicket")
form.textField("textField")
form.show(player).then( (result) => {
const [ FreeChatRank ] = result;
if (result.canceled) return;
player.runCommandAsync(`tag @s add "ListChatRank:${FreeChatRank}"`)
})
}```
function FreeChatRankTicket(player) {
const form = new FantasyWorldUI.ModalFormData()
form.title("FreeChatRankTicket")
form.textField("textField")
form.show(player).then((result) => {
if (result.canceled) return;
const [FreeChatRank] = result.formValues;
player.addTag(`ListChatRank:${FreeChatRank}`)
})
}
does it even show the form
i think your textField is missing something
it work!!!!!