The following warnings occurred: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Warning [2] Undefined array key "avatartype" - Line: 783 - File: global.php PHP 8.1.31 (Linux)
|
Way to check for same name of entry and error? - Printable Version +- Form Tools (https://forums.formtools.org) +-- Forum: Form Tools (https://forums.formtools.org/forumdisplay.php?fid=1) +--- Forum: General Discussion (https://forums.formtools.org/forumdisplay.php?fid=5) +--- Thread: Way to check for same name of entry and error? (/showthread.php?tid=234) |
Way to check for same name of entry and error? - msaz87 - Aug 8th, 2009 Hey all, I'm wondering if there's a way to set up a form submission to read the entry in a specific field and check it against the current entries. If the entry is a duplicate, it would respond with an error. The use of this is for the registration of teams in a league... so basically I'd be using it to prevent duplicate team names. If "Team A" is already taken and then another team comes along and tries to register with it, the entry wouldn't be submitted and an error would pop up saying "Name taken". Thanks for any help! RE: Way to check for same name of entry and error? - Ben - Aug 11th, 2009 Heya, Sure! The API actually includes a function for this very purpose: ft_api_submission_is_unique The idea is that you feed it whatever criteria you want to determine "uniqueness" - in your case, team names. Give that page a read through. Hopefully it will give you some ideas on how to get it working for your form. - Ben RE: Way to check for same name of entry and error? - msaz87 - Aug 11th, 2009 Great! Thanks for your help, Ben. I've never used the API before, but I'm sure it'll be easy enough to learn. Love the script! |