Jump to content

Saving data using formhelper, Custom Validation registration

Featured Replies

Posted

I've just started creating plugins for IPS and was planning some modifications to the register page. What I want is to validate the members input beyond what is already available within the profile-fields you can add.

So I downloaded this:

And I did some modifications:

(I've added my own validation class above)

And this works great :) However, I wan't to save the values from the registration form, otherwise, whats the point of the validation ;)

So, simply, how do I save what using the form-helper (is it easiest to use profile-fields, cause then I can easily edit the value in the admincp)?

  • Author

What I did for now, until I have a better solution was simply editing the register.php file (applications/core/modules/front/system/register.php)

4b57af4d77877fcb5f216d092b66b68f.png

Adding 

$profileFields[ "field_3" ] = $values['pnum'];

before the custom profile fields and of course first creating a profile field with these settings:

4f31d3cfdd979015c7ec5dd4f5b4d6d1.png

I guess there is a better way, but hey, it works for now ;)

  • 1 month later...

We are working on improvements to custom profile fields. They probably won't be available until a major release, but I'll look to see if your need can be accomplished during the refactoring. Essentially, you just need a way to apply a custom validation function to a custom profile field it looks like.

  • 4 weeks later...
  • Author
 

We are working on improvements to custom profile fields. They probably won't be available until a major release, but I'll look to see if your need can be accomplished during the refactoring. Essentially, you just need a way to apply a custom validation function to a custom profile field it looks like.

Yes, my idea would be to it work like classes in css, you can append classes to your custom fields, and then you have a single PHP file that have a list with cases and if that field matches any (or all of them) it will be checked against those "validation classes". I would also like a built in function for IPS to make sure a field is unique.

Something like this:

Archived

This topic is now archived and is closed to further replies.

Recently Browsing 0

  • No registered users viewing this page.