The following warnings occurred: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Warning [2] Undefined array key "avatartype" - Line: 783 - File: global.php PHP 8.1.31 (Linux)
|
uniqueness without api? - 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: uniqueness without api? (/showthread.php?tid=1896) |
uniqueness without api? - tmjcbs - Feb 11th, 2012 Hello, I would like to implement a test for uniqueness of one of the fields (called 'bsn') and reject a submission if that is not the case. I know that this can be done with API processing, but I'd rather not make the switch to that, I lack enough knowledge for that. What I did do however is make the field unique, that seems to do exactly what I want: it deleted a few hundred duplicate submissions and prevents further submissions with a bsn that is already in the database. The only problem is that after submission the user ends up on an error page without any real information why their submission failed. Is there a not-too-difficult solution to this? Thanks, Theo RE: uniqueness without api? - Ben - Feb 11th, 2012 Hi Theo, We can probably figure something out, sure! So how have you rigged it up so far? You're POSTing your form to process.php? How are you preventing future submissions with the same BSN number? (The Submission Pre-Parser or Hooks Manager module?) - Ben RE: uniqueness without api? - tmjcbs - Feb 12th, 2012 Hello Ben, Thanks again for your quick reply. I'm sorry for not adding a 'problem solved' reply myself, because, well...I solved the problem. Since I'm trying to add as much inline and realtime validation as possible I knew I had to look for a solution that queries the database directly after an 'onblur' of the field that has to be unique. I found that script here: http://www.digimantra.com/technology/javascript/check-username-availability-validation-ajaxphp/ I don't quite understand what's happening there (especially the pullAjax function), but I got it to work perfectly. On an onblur of a duplicate bsn entry (that was the field that had to be unique) a message appears that that there's already a submission with that bsn number and the 'send' button is disabled. Anyway, I'll check out the submission pre-parser and hooks manager modules, thanks for pointing me to them. Thanks, Theo RE: uniqueness without api? - Ben - Feb 17th, 2012 Nice! Glad you figured out a solution! - Ben |