Form errors not showing

Permalink Browser Info Environment
Using this great add-on with your other form add-on variant (tableless layout).

Using the Ajax on home page and two other normal 'tableless' forms on other pages.

Ajax shows errors with missing required inputs, the others do not?

Using C5 5.6 and github version of Ajax with no template selected on home page.

The others are using templates, one with a file upload.

I'm I doing something wrong?

Try using forms to see.

Dev site home page with Ajax:http://test.55webdesign.co.uk/

And contact page with normal:http://test.55webdesign.co.uk/contact/...

Thanks

Steev

Type: Discussion
Status: New
Steevb
View Replies:
jordanlev replied on at Permalink Reply
jordanlev
Hi Steev,
Sorry, I'm not sure what would be causing that issue. It sounds like you're saying that the ajax form is working fine but the "form tableless layout" one is not showing error messages when someone leaves a field blank? Do the non-ajax form blocks work if you change the template back to C5's built-in default?
Steevb replied on at Permalink Reply
Steevb
Okay, It seems to be an 'Ajax' issue. If I remove the 'Ajax' form folder from the 'blocks' folder everything works as expected, except I'm not getting 'placeholders', the reason I wanted the github 'Ajax' version.
Is there is a way of putting 'templates' in the github version?
jordanlev replied on at Permalink Reply
jordanlev
This might actually be an issue with the overrides cache -- can you see if that's enabled, and if so disable it and check if the Ajax form works then? (Probably clear the cache too for good measure).

-Jordan

> On Oct 10, 2013, at 9:51 AM, concrete5 Community <discussions@concretecms.com> wrote:
Steevb replied on at Permalink Reply
Steevb
Thanks for getting back.

Never have cache set on.

Always clear cache.

Still no go.
jordanlev replied on at Permalink Reply
jordanlev
Hey Steev,
I just re-read your original question a few times to see if I could understand the situation better (it's tough without being able to step through the actual code)...

I think what's happening is that the form block is *always* using the overridden controller that's part of the ajax_form code (even if you choose to use a non-ajax template). While C5 provides a way to have multiple views (custom templates) for each block, it does not extend that functionality to controller overrides. So your options are either:

1) Convert your form-tableless-layout templates to use the ajax form template (they're pretty similar, and I haven't run across any situations myself where there was some reason to *not* apply ajax to the form).

2) Switch over to the older "Ajax Form" addon (http://www.concrete5.org/marketplace/addons/ajax-form/... ). Since the addon doesn't override the controller, it might avoid this problem.

Good luck,
Jordan
Steevb replied on at Permalink Reply
Steevb
Thanks for trying to help with this issue.

Let me try to explain it another way (I'm hopeless with php)

I want the forms to have 'placeholders' (as your github version).

With your tableless form, I can get '.msqID' to show by adding 'placeholder' to the form_minisurvey.php file in the core, but not .$questionRow['question'], as used by the 'required' option.

I thought if I added placeholder="'.$questionRow['question']'

to lines 269 down to 285 (form_minisurvey) that would show whatever the user set as 'question' when setting up the form.

All I would like to do is have 'placeholders', I can hide labels with css if needed.

Have tried several combination for several days without success.

Your github version works well, but has no template options.

So...

If I can get 'placeholders' to work with 'form_minisurvey' I'd be happy.

Or if I could have 'templates' with your 'github ajax form' I'd be happy.

Does that make sense?
jordanlev replied on at Permalink Reply
jordanlev
Is there some reason you can't use custom templates with the github version of the ajax_form addon? It should work just fine that way (as long as you have the overrides cache disabled during development -- which you do).
Steevb replied on at Permalink Reply
Steevb
The Ajax (Github) form uses a view.php, there isn't any reference to a template folder.

The controllers for both Ajax forms (MP and Github) are different.

Should I try to combine them, so I can reference the templates?
jordanlev replied on at Permalink Reply
jordanlev
Don't combine the marketplace and github versions -- while they are similar, they're not 100% compatible with each other.

The github version is a bit confusing because it's not an addon/package... but really it's no different than any other block override in C5. There should be no reason you can't just add your own "templates" folder in there, copy the "view.php" file into the templates and rename it to what you want your template to be named. You can't do this with "controller.php", but you definitely should be able to with the view.

Of course now that I've said that, it's possible that there's some weird behaviour in the system that will make it not work the way it should -- but hopefully it does work so I'd definitely try that first before taking more drastic measures.
Steevb replied on at Permalink Reply
Steevb
Okay, thanks for that.

Doing what you suggested is a step in the right direction, but I now two sets of labels (one inside and one outside). Can't believe I missed that option?

Anyway will into this a bit deeper.

Many thanks
Steevb replied on at Permalink Reply
Steevb
Okay, spent the day manipulating and have everything working bar the error message when using a 'file upload' question.

Is there a way to get 'file upload ' to play nicely?
jordanlev replied on at Permalink Reply
jordanlev
What is the error you're getting with 'file upload' fields? (remember that I'm not looking at the site you're building :)
Steevb replied on at Permalink Reply
Steevb
Sorry to be a pain.

I meant the error message is NOT being shown with the 'file upload' question in place.

Everything else is working as predicted.
Steevb replied on at Permalink Reply
Steevb
Got error message to show with file upload question.

Line 60 (controller) for hasFileUpload changed to false.

Next issue is how to remove 'placeholder' inside file upload question.
Steevb replied on at Permalink Reply
Steevb
Jordan,
Very happy with ajax placeholder form (github version).

As I previously mentioned, setting ($hasFileUpload = false;) on line 60 of the controller now works with 'fileupload' question.

Shows error message when a required input is missed out.

Would be nice to able to include in my theme package, but I can't get it to work.

Never mind, it now works great for me.

concrete5 Environment Information

Browser User-Agent String

Hide Post Content

This will replace the post content with the message: "Content has been removed by an Administrator"

Hide Content

Request Refund

You have not specified a license for this support ticket. You must have a valid license assigned to a support ticket to request a refund.