7

I assume that EE's native file upload functions use the Upload class, but what exactly does the Upload class do to validate and sanitize? Does it check MIME type using some sort of actual file analysis, or does it simply rely on what the browser reads it as? The Upload class uses the $_FILES array and it does use $_FILES[]['type'], but we do some ...


5

If your field is a Matrix field, just checking the native "Is this a required field?" is not sufficient. You need to look further down in your Matrix columns. There is an "Is col required" setting for each column in your matrix field. Tick those and presto, required columns in a matrix field. You can also constrain the number of rows by using the min rows ...


5

First, no need to ever load directly from CI - you can always use EE. (So, $this->EE->load->helper('file').) Same with your validation class - I'd extend Form_validation, not CI_Form_validation. (Generally, EE should serve as your path to anything CI-related to avoid any conflicts.) You'll need to load your custom validation library, and call it ...


4

This is far from obvious how to achieve in EE, and it's not really documented at all. A long while ago I wrote up on Stack Overflow how we (used to) do this in Store, and this was in turn based on how SafeCracker (now Channel Form) did it. However, I've since figured out an even cleaner way to achieve it (Channel Form, FreeMember, and many other add-ons use ...


4

... when the form fields are filled out correctly ExpressionEngine itself throws an "x Field Required" error message("Email Field Required" for the Comment Form ... The comment form code that you've posted includes a from field, not an email field. It seems pretty likely that EE is looking for $_POST['email'] and then bailing when it can't find it. The ...


3

You don't need to run this through EE at all if you don't want to. Simply create your PHP script outside of EE's templates and have the form post its data there. I did something very similar to what you need recently to send data from a contact form to a CRM system. They supplied a ready made PHP script (which used CURL) to get the data to the CRM. I just ...


3

That's the native EE forum template. I suggest using the jQuery Validation plugin http://jqueryvalidation.org/. You can add the code to the forum header template. I don't know the header template name offhand but it should be in the same directory. <form id="registration" action=""> <input id="email" type="email" name="email" required> &...


3

You're using the wrong hook. Try using entry_submission_start and/or publish_form_entry_data Update: Abort the channel entry publish process? Head-scratcher: manipulating new/updated entries after submission


3

You could do this by using the inline_error_return="" parameter: http://www.solspace.com/docs/freeform/form/#inline_error_return For example, you could craft a special URL when inline errors are encountered, eg: return="template_group/template/errors_found" Then, in your template, use a simple conditional to display your "has errors" message: {if ...


2

You could build a custom extension that queries the database (I think exp_channel_titles) for the url_title supplied, then return an error to the user if it already exists. You would probably want to look into the safecracker_submit_entry_start hook. Alternatively, you could use JavaScript and perform some validation on the front end that passes the ...


2

From OP in comments above: Just wanted to follow up and take credit for a simple mistake that monopolized more time than I'll ever admit. Turns out in my zoo form I had "new_row_0" in one of my hidden fields where it should have been "row_new_0".


2

Your problem is your selector: $('form#example-register input#register'). The submit event is tied to the form, not the submit button. Try changing your selector to $('form#example-register'). Also adding a console.log('submit') into the function is good to even see if the event is getting called. Also, while input[type="submit"] is accepted, IMO it's ...


2

I think, you need to look into that channel preferences under "Channel Posting Preferences". You can see "Default HTML formatting in channel entries" and set it to "Convert HTML into character entities". I hope, it would work for you.


2

As far as I can see you have not assigned an event to validateForm(). Nothing is executing this query, not so strange that it's not working. For example Ise jQuery to assign the function to you submit button. Something like this: $(“input[type=submit]”).click(function(){ ValidateForm(); });


2

I never used Solspace Freeform, but, looking at the docs, I had one idea. form:ATTRIBUTE_NAME= This parameter allows you to control any form attribute for the form in your template. Simply replace ATTRIBUTE_NAME with an attribute name such as id, name, class, onsubmit, etc, and specify a value for that attribute. You can specify this parameter multiple ...


2

To stop the posting of the forum, you can use jQuery submit: http://api.jquery.com/submit/ The code would look something like this: $(window).ready(function() { $('#mx_locator').submit(function() { if ($('#mx_zip').val() == '' && $('#mx_city').val() == '') { // Additional code here to light up the input or display error ...


2

You can use the Forms JS Validation plugin http://devot-ee.com/add-ons/forms-js-validation You can add basic and complex validation to your forms without modify the form tag itself.


2

To troubleshoot forms which are submitting but not displaying errors, you should always remove error_handling="inline" as a first step (as Justin mentioned). This means all errors will be displayed, in case you have forgotten to template any inline errors. To clarify what it sounds like your underlying problem was: If any custom member fields are marked as "...


2

The simple answer would be to go through the add-on code and replace any ampersands with html entities but I'm guessing you've already tried that? I don't think there will be a quick way to do it other than doing that. I would say that you really don't need to worry about it. Validation is a guide, not a requirement. Especially at this level. Are you ...


2

I have come across an old safecracker extension that seems like it may be able to be modified for use with channel forms to handle this, as well as also protecting any other fields from being tampered with that are not explicitly allowed by the extension: http://devot-ee.com/add-ons/safesharpener It may be possible to just try editing the hook name to the ...


2

Take a look at the Code Ignitor Validation Helper. You can use this within PHP on an EE template, it really is as easy as this (example from the CI Docs), just replacing $this with a reference to EE : function gmail_only($value){ return ( stripos(strtolower($value), '@gmail.com') !== false ); } ee()->load->helper(array('form', '...


2

Ok I figured out what is the problem. This is the correct, pubDate format incase someone else encounters this problem in the future... <pubDate> {gmt_entry_date format="%r"} </pubDate> I spent 2 hours for simple thing like this... Might save someone else the time in the future.. You're Welcome


1

Perhaps you can give the Forms JS Validation plugin a try http://devot-ee.com/add-ons/forms-js-validation. Example: {exp:forms_js_validation:init} {exp:forms_js_validation:add selector=".contact" input_element_wrapper=".input_container" require_class="require" } {exp:freeform:form form_name="contact_form" template="contact_email" form:class="...


1

The User Message templates are the native behavior of EE, but there are some addons that you can use to work around them. A 3rd party addon like Free Member https://github.com/expressodev/freemember can display errors like required fields inline to avoid EE's user message templates. Beyond that if there is a specific message you are trying to avoid from ...


1

doubleplusgood, I think you're answer's right there in the jQuery Form documentation, plus a little research to do outside. the outside part is that good practice for your EE-side ajax response is to be simple -- no HTTP error codes should be used, even on error. Just return the div contents from EE that you want to show, whether you indicate success or ...


1

If I understand you correctly then you don't really need to know what function EE is using but simply submit your login form via Ajax to the URL it would normally submit to. You might also want to look at these add-ons. Some of them cost a few dollars but they will probably cost less than the time you will spend on trying to create the same functionality. ...


1

I'd suggest using one of the two add-ons available for adding registration code functionality. There is two commercial add-ons for this purpose out there that I can see: Invitations and Registration Codes I haven't tried out either of them, and you'll still have to work on the import side, which shouldn't be too difficult. But at least these add-ons ...


1

Without thinking about it too much I would just create a totally separate database table that contained all the valid subscription codes. Then when a user wants to validate you can do a lookup from that table to find a matching ID. If you need to take it further you can then have that ID either stored in a custom member field or else store their member ID ...


1

It seems that your form3 isn't getting entry id or url_title for the entry which need to be updated. In the case you are getting issue by passing entry_id or url_title as parameter within the edit tag dynamically, just put hidden field for entry_id or url_title like: <input type="hidden" name="entry_id" value="[ENTRY ID]" /> OR <input type="...


1

The simplest thing to do would be to create a fake email address for each member. The easiest way I can think of to do this would be via a small PHP script (might even be possible in Excel) that iterates a counter and inserts "user*n*@fakemail.com" into the relevant "slots" of your data source. Then import that into ExpressionEngine.


Only top voted, non community-wiki answers of a minimum length are eligible