The following warnings occurred:
Warning [2] Undefined array key "avatartype" - Line: 783 - File: global.php PHP 8.1.31 (Linux)
File Line Function
/global.php 783 errorHandler->error
/printthread.php 16 require_once
Warning [2] Undefined array key "avatartype" - Line: 783 - File: global.php PHP 8.1.31 (Linux)
File Line Function
/global.php 783 errorHandler->error
/printthread.php 16 require_once
Warning [2] Undefined variable $newpmmsg - Line: 40 - File: global.php(841) : eval()'d code PHP 8.1.31 (Linux)
File Line Function
/global.php(841) : eval()'d code 40 errorHandler->error
/global.php 841 eval
/printthread.php 16 require_once
Warning [2] Undefined array key "style" - Line: 909 - File: global.php PHP 8.1.31 (Linux)
File Line Function
/global.php 909 errorHandler->error
/printthread.php 16 require_once
Warning [2] Undefined property: MyLanguage::$lang_select_default - Line: 5024 - File: inc/functions.php PHP 8.1.31 (Linux)
File Line Function
/inc/functions.php 5024 errorHandler->error
/global.php 909 build_theme_select
/printthread.php 16 require_once
Warning [2] Undefined array key "additionalgroups" - Line: 7162 - File: inc/functions.php PHP 8.1.31 (Linux)
File Line Function
/inc/functions.php 7162 errorHandler->error
/inc/functions.php 5044 is_member
/global.php 909 build_theme_select
/printthread.php 16 require_once
Warning [2] Undefined array key 1 - Line: 1415 - File: inc/functions.php PHP 8.1.31 (Linux)
File Line Function
/inc/functions.php 1415 errorHandler->error
/inc/functions.php 1370 fetch_forum_permissions
/printthread.php 76 forum_permissions
Warning [2] Undefined array key "showimages" - Line: 160 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 160 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 165 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 165 errorHandler->error
Warning [2] Undefined array key "showimages" - Line: 160 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 160 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 165 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 165 errorHandler->error
Warning [2] Undefined array key "showimages" - Line: 160 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 160 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 165 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 165 errorHandler->error
Warning [2] Undefined array key "showimages" - Line: 160 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 160 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 165 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 165 errorHandler->error



Form Tools
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! Smile

- Ben