#Problem with modal values

1 messages · Page 1 of 1 (latest)

tranquil sphinx
#

I've been trying to retrieve the values ​​from the modal for a week, here is the part of the code and I have this help (https://old.discordjs.dev/#/docs/discord.js/14.9.0/class/ModalSubmitFields?scrollTo=getTextInputValue) that was given to me but I can't manage to use it in my case. can u fix it? ```
courseCollector.on('collect', async i => {
if (!i.isButton()) return;

  if (i.customId === 'buttoncourse') {
    await i.showModal(modalCourse);
    const modalSubmit = await i.awaitModalSubmit({ filter: courseFilter, time: 300000 });
    
    if (modalSubmit.customId === 'courseModal') {
      courseName = modalSubmit.values.nameInput;
      date = modalSubmit.values.dateInput;
      respName = modalSubmit.values.nameRespInput;
      console.log('Course modal input');
    }
    await modalSubmit.reply({ content: 'Sélectionner une discipline', components: [selectRow], ephemeral: true });
  }
});```
silk sierra
#

modalSubmit.fields.getTextInputValue('nameInput') assuming you named your TextInput with customId nameInput