#how to control when all fields are empty

1 messages · Page 1 of 1 (latest)

ripe oxide
#

hi im new on appsmith, what you guys recommend me im trying to create a modal to create a new product (inventory system) but when i click Save, its creating a empty record on my db, any chance to control that? thank you

grave martenBOT
#

Hi There!
Thanks for reaching out to us. One of our engineer will be with you shortly.

If you are stuck with an issue/error, please help us with following information.

  1. Which version of Appsmith are you on?
  2. Provide screenshots/screen recordings of the original error/code snippet.
  3. Add details about your use case and provide steps to reproduce the issue, if
    possible.
ripe oxide
#

i need to know if thers any option to control when a modal is empty show a error message (customized) and avoid creating a empty record on mysql

grave martenBOT
#

Hi! Sorry for the late reply. For the first issue, you could use a form and make
the fields “required” or you could create a JS function inside a JS
Object

that validates the data before submission.
For the second issue, this documentation on the [Select
widget](https://docs.appsmith.com/reference/widgets/select#displaying-data
[https://docs.appsmith.com/reference/widgets/select#displaying-data]) should
help.
Let us know if you face issues or have more questions.

JavaScript(JS) is a programming language used on both the client and the server-side. It also supports the creation of an object known as JavaScript Object (JS Object). Javascript object is a collection of properties designated by a key-value pair. In this guide, you’ll learn how to use JavaScript(JS) objects within Appsmith.

‌Select / Dropdown widget is used to capture user input/s from a specified list of permitted inputs.

ripe oxide
#

i already have my fields required

#

also i got my mysql fields as not null

grave martenBOT
ripe oxide
#

i did turned off that property from Save button but still

#

i tried with both disabled invalid form enabled an disabled

grave martenBOT
#

Can you share a screenshot of the query and it’s Settings tab?

ripe oxide
#

thats save product query

#

and settings

#

see all my fields are required but still saving empty records on mysql

ripe oxide
#

i tried form without modal and everything works as expected

#

may be a issue with modal and those kind of things?

grave martenBOT
#

You would need to move those Input fields inside a form. Otherwise, you can
create a custom JS function that validates the entries before the query gets
run.

ripe oxide
#

thank you, ticket may be closed