This forum has moved, please join us on github discussions. We will keep these old posts available for reference. Thank you!

Form Customization

I am trying to build a form, and have encountered some peculiar behavior. I am not sure if I am at fault due to ignorance, or if I am misunderstanding what Apostrophe is trying to do.

  1. I have multiple button tags in my form. I only have one button that is of type submit. However, it seems all buttons are trying to submit the form. Is this a bug? it seems rather obtrusive to make all button tags submit the form.

  2. Is there any documentation on how to handle file uploads?

Hi Jeff, have you read this?

http://apostrophecms.org/docs/tutorials/intermediate/forms.html

Recommend you take the question to Stack Overflow, tag it apostrophe-cms, and provide more details. It is difficult to figure out what you are doing without context.

Thanks!

Yes, I have read that, and executed the tasks. The tutorial worked great.

However now I am trying to customize the form and running into problems. I have tried asking on Stack overflow and gotten push back, or vague answers to my inquiries.

In the tutorial, the submit button has no type attribute, which I find very puzzling, since it goes against W3C best practices. Furthermore, I don’t understand why the form tries to submit when clicking ANY button thats inside the form. Can you confirm that the form submits any time any button in the form is clicked?

In most browsers type=“submit” is the default for button elements. If you don’t want them to trigger a submit event in the browser, set a different type. That’s nothing to do with Apostrophe really, it would happen in a plain HTML page outside of Apostrophe.

Thanks Boutell. I had no idea about that default behavior.