Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

Form Questions /

Custom Form Submit Button Not Firing


Reply


3 Posts   648 Views

Avatar
B00mtastik™

Community Member, 18 Posts

13 August 2013 at 7:33am

Edited: 13/08/2013 7:35am

Hey Stripers,

I created a very simple page type with a form on it. Extension of Page not form. I saw a tutorial and it looked simple enough to reproduce. I got everything to work in the sense that if I called the entire form IE: "$MyCustomForm" in my templates, the entire form shows up and submits to the database I've told it to, and it works well. Including required fields.

Now, when I loop through the form to get individual fields via $Fields.fieldByName('FirstField') that shows up find as well. I do the same for $Actions and then $Field for actions to get my submit button to show up at the end. I did it this way so I can have find tuned control over what the page itself will look like. And while the template works well, the submit button does not. It doesn't even fire. No error, and in chrome during expect element nothing gets pushed or passed through php either. Its sitting there with class attributes but feels essentially like an empty button.

Any ideas why this could be happening? That calling the entire form straight works perfectly. But calling each field manually/separately causes the submit button to stop working?

Thanks in advance.

-b00mer

EDIT:

NOTE: Am using SS 3.0.5 on a Dreamhost Dedicated Server with bootstrap 2.3 (which I will be moving to foundation 4 soon enough)

Avatar
Willr

Forum Moderator, 5513 Posts

14 August 2013 at 8:10pm

Javascript validation on the form running when you click submit?

Avatar
B00mtastik™

Community Member, 18 Posts

15 August 2013 at 10:33am

Hey Willr,

Nothing would happen at all when clicking submit. As if it was an image. The only that would work was the hover over effect on the button itself.

I figured out after looking at the html outputs that it might have something to do with the hidden input fields regarding the security token, then confirmed it on the IRC channel when they mentioned the CSRF token check and low and hold it was. It was also me no including the <form> tags along with $FormAttributes, hence the button wasn't being seen.

All working now with <form $FormAttributes></form> adding to the form area and <% loop HiddenFields %>$Fields<% end_loop %> on the template file.

Thanks

-b00mer