Custom Signup Field Validation

If you're a new user of AppGini, feel free to ask general usage questions, or look for answers here.
Post Reply
thecomputerchap
Veteran Member
Posts: 47
Joined: 2016-08-28 10:37

Custom Signup Field Validation

Post by thecomputerchap » 2018-03-31 10:27

Hi all,

I'm trying to do something and I'm a bit stuck so I need your help...

I have the custom1 field set to 'Business Name' when a user signs up. I am trying to apply validation checks to this field so that it behaves similar to the username field. There are no minimum number of characters like the username but I need to have AppGini check to see if there is a business name that already exists already in the custom1 field of the database as the user fills the field in.

To demonstrate how I need this to work, go to your signup form and start typing in a username. AppGini uses Ajax to check if a username already exists in the database as you type. I basically need this same functionality applied for the custom1 field too.

I'm not sure how to go about doing this...

Thanks all in advance for your help!

User avatar
jmcgov
Veteran Member
Posts: 79
Joined: 2018-12-19 01:31
Location: Northern Ireland

Re: Custom Signup Field Validation

Post by jmcgov » 2019-06-17 23:04

Can someone respond to this question, please?

User avatar
a.gneady
Site Admin
Posts: 1281
Joined: 2012-09-27 14:46
Contact:

Re: Custom Signup Field Validation

Post by a.gneady » 2019-06-22 15:55

You could add JavaScript code in hooks/footer-extras.php for validation … First, check that the URL is "membership_signup.php" and if so, add a form submission handler to check the field values … and if a value is invalid, show error and return false to prevent submission:

Code: Select all

<script>
    $j(function() {
        // if not signup page, skip
        if(!location.href.match(/\/membership_signup\.php/)) return;

        $j('form').submit(function() {
            // add your checks here and return false if invalid, else return true
        });
    })
</script>
:idea: AppGini plugins to add more power to your apps:
  • DataTalk is an innovative AppGini plugin based on ChatGPT that allows you to interact with your AppGini database using natural language questions, without writing any SQL. Check the demo video
  • Mass Update plugin: Update multiple records at once and improve your workflow efficiency.
  • Check our other plugins and get a generous discount of up to 30% when buying 2 or more plugins.

Post Reply