Form to email action steps

I noticed that form field Post vars from a previous form (not the one currently being worked on) are listed.
Also the same for setup mailer properties.

Is this normal?

You will need to create a different server action for your current form for the @_POST variables to reflect the current form.

I did but the question remains…

Any chance of a video to show what is happening?

Well I deleted all of the previous actions.

The forms were created in the same project. I assume that the variables stay available (is that the correct word? or live) in the project environment.

I have two forms in my project, namely a contact form and a signup form.

These are the $_POST variables for the signup form

and the following for the contact form

This tutorial may help you: https://docs.wappler.io/t/sending-form-data-to-email/2858

1 Like

OK so that’s how it is supposed to work. Variables hang out in the IDE per project.

Not sure what you mean by that, the IDE has little to do with it except that it facilitates the procedure.

Each form has input fields and an action file that uses the values of the input fields for subsequent processes. Assuming that the form method has been set to 'post', the values of the input fields are contained in a corresponding $_POST variable. Therefore it is important to make sure that the name attribute of the input fields (e.g. <input type="text" name="name">) is the same as the $_POST value (e.g. $_POST['name'])

For more, have a look at https://developer.mozilla.org/en-US/docs/Learn/HTML/Forms/Sending_and_retrieving_form_data

what I mean is that variables from form1 show up when I work on form2 in the same project when building a form to email. Does this happen if the server action name is the same? I was working on two forms with the action name set to formtoemail.

You should not use two actions with the same name unless they are in different folders.

1 Like

Hah! I figured that out.