latest stable versions: v150827 (changelog)

Old Forums (READ-ONLY): The community now lives at WP Sharks™. If you have an s2Member® Pro question, please use our new Support System.

Required fields allowing submission if blank

Home Forums Community Forum Required fields allowing submission if blank

This topic contains 4 replies, has 2 voices. Last updated by  greaterlightmedia 4 years, 4 months ago.

Topic Author Topic
Posted: Friday Aug 24th, 2012 at 11:10 am #22983

Hello
I have created two custom fields for my registration form ‘Company/Organization” and “Title”

I have set them to REQUIRED in Registration/Profile Fields Options panel but the form is allowing submission with these fields blank.

I do see this little blurb when I click the “edit” icon for the fields “If yes, only Users/Members will be “required” to enter this field. * Administrators are exempt from this requirement. I am not really understanding that.

My question is, how do I force an entry in those two custom fields.
The site is using Open Registration. No one pays for anything at this moment in time. Once a user completes and submits the reg form they are set to Level 0

thank you

List Of Topic Replies

Viewing 4 replies - 1 through 4 (of 4 total)
Author Replies
Author Replies
Posted: Saturday Aug 25th, 2012 at 6:41 am #23041

Hi there.

I have set them to REQUIRED in Registration/Profile Fields Options panel but the form is allowing submission with these fields blank.

Is this happening to everyone? If so, you may be having a JavaScript problem. Only to some? Then those users may not have JavaScript working in their browsers. The requirement is checked with JavaScript, not server-side at the moment, although we’ll be adding it in the near future.

Could you share a link to the registration page?

I do see this little blurb when I click the “edit” icon for the fields “If yes, only Users/Members will be “required” to enter this field. * Administrators are exempt from this requirement. I am not really understanding that.

Basically means that if you’re an administrator of the site, you won’t be required to fill out those fields, like when you edit your profile.


I hope it helps. :)

Posted: Saturday Aug 25th, 2012 at 11:18 am #23056

Hi Cristian
Yes this helps. It is happening for everyone. Issue with Javascript makes sense. The form is being loaded in a pop up.

Here is a link to the form http://www.huntfortruth.org Click any of the JOIN links to access the form
thank you

Posted: Sunday Aug 26th, 2012 at 7:29 pm #23127

Okay.

This is part of a conversation I had with Jason some months ago regarding JavaScript conflicts.

Cristián: I still don’t understand how the JS conflicts work… If the library is the same in both plugins, why is there a conflict? Same var names?

Jason Caldwell: Well, I call it a conflict. Sometimes it’s a conflict in jQuery because of a bad plugin, which attempts to load jQuery on it’s own, instead of doing it the WP way. Or sometimes, it just a bad plugin that causes a JavaScript error, which may result in all JavaScript failing (the nature of JavaScript). Not really a “conflict” in that case, really an error due to a bad plugin/theme.

Jason Caldwell: I’ve also see some conflicts between frameworks. That’s rare, but there are some plugins that use the ProtoType framework, and combined with another framework like MooTools, there is a possibility for a conflict to arise. Rare though, and it’s usually attributed to the way their loaded (i.e. by a bad plugin/theme).

Cristián: Does WP load JQuery already? If so, why do plugins load it too?

Jason Caldwell: Yea, WP already loads it. But some plugin authors don’t know that, or they just hard code it into their plugin not realizing that. Other times they’ll try to include a dependency on jQuery, but they name it wrong, and WordPress gets confused.

Cristián: Does s2Member load it again or uses WP’s?

Jason Caldwell: Hmm, not really, because in the Dashboard, it’s already loaded by WordPress. s2Member enques scripts that is uses, which rely on jQuery being present. In the call to wp_enqueue_script(), s2Member will list jQuery as a dependency, which forces WP to load it, though it’s already loaded in the Dashboard anyway. That’s the proper way to handle it.

On the front-end of a site, s2Member will load jQuery if it’s not already loaded, but again, using the same technique. A call to wp_enqueue_script() with a dependency on jQuery forces WP to load jQuery. If 10 plugins all do it this way (i.e. the right way), WordPress loads jQuery in the proper order and only one time.

Cristián: Ah, got it. I understand WP has a QC team, don’t they check this?

Jason Caldwell: Not in my experience. They look mostly for security issues and really bad code. They usually don’t catch minute details like this.

Cristián: I see. Well, they do look at how the db is used, iirc.

Cristián: I see, but these details do cause trouble for the users. Maybe it’d be good to write an article about JS conflicts as you explained above and post it in the forums, and then show it to the QC guys for consideration to include in their quality checklist.

Jason Caldwell: Yea, that’s a good idea. On the WP side though, they’re aware of this problem, and that’s why they created the wp_enqueue_script() wp_enqueue_style() functions. Although, I wish this were more prominent in this article: http://codex.wordpress.org/Writing_a_Plugin#Plugin_Development_Suggestions

It is mentioned, but it’s all the way at the bottom:

Try not to echo [hilite code]

Old Forums (READ-ONLY): The community now lives at WP Sharks™. If you have an s2Member® Pro question, please use our new Support System.

Contacting s2Member: Please use our Support Center for bug reports, pre-sale questions & technical assistance.