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!
Custom Signup Field Validation
-
- Veteran Member
- Posts: 47
- Joined: 2016-08-28 10:37
Re: Custom Signup Field Validation
Can someone respond to this question, please?
Re: Custom Signup Field Validation
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>
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.