Forum

Thread tagged as: Question, Forms, Members

Reset/clear form data

Is there a way to reset or clear the form data on submit or with a reset button.

My register form on the members app does not clear the members details once submitted.

Thank you.

Denise Courtney

Denise Courtney 0 points

  • 5 years ago
Showing the success message and the form
You can redisplay the form along with the success message by setting show-form="true" on the perch:success tag. This is useful for things like edit forms.

<perch:success show-form="true"> ... </perch:success>

Maybe this would help.... But I'm not holding my breath. :)

Thanks for the help but no that didn't work. Ideally I want to only show the success message but when I then return to the form to say register another member the previous data is still there.

Thanks also for the code a few days ago too, haven't quite got round to trying that bit yet.

Denise, In the past I have set

$_POST = array();

to clear post data to prevent re-populating the forms. This works still, but it seems to me there is somr function for doing this. Also, the other way to prevent re-populating a form with same data is to use a link to the page again which will empty the $_POST variable. If the page contains more then one form, then after success, the other forms will be populated with same fields because the $_POST variable still contains the previous information.

Thank I'll take a look at that.

I have another issue to do with the members app I wanted help with. Can I email you?

There is a listing of Registered Developers at https://grabaperch.com/developers. You can find Several Developers as well as myself listed who would be more then happy to assist. :)