Checking for Duplicate Student ID
Hi:
I need to check for duplicate Student ID at the moment of data entry. Is there a DA Behavior that can do that? And, if so, how is it applied to the S. ID field?
Thank you for your attention
Hi:
I need to check for duplicate Student ID at the moment of data entry. Is there a DA Behavior that can do that? And, if so, how is it applied to the S. ID field?
Thank you for your attention
You can use Server Validation to do this. There is a Duplicate Record validation you can use to validate the value doesn't already exist in the database.
Ray:
I've tried more than a couple of times using the Server Validation behavior and I always get the following error message:
Fatal error: Call to undefined function WAValidateAN() in C:\xampp\htdocs\StuRex.com\StuRexInsert.php on line 30
Any suggestions?
Attached please find a copy of the page in question
Thank you for your attention
Dreamweaver put the includes in the wrong spot. Move lines37-40 to the top of the page.
Ray:
I moved lines 37-40 to the top of the page as you suggested and now the error message is gone, but the Student ID field is accepting duplicate ID codes. I’ve entered an already-existing ID twice and DW took it both times.
Any suggestions?
Attached please find a copy of the page in question
Thank you for your attention
It looks like you just have Alpha-numeric validation on that field... you need to add "Unique value in database" validation to validate it is unique.
Ray:
There is no option “Unique value in database” in the Server Validation list (please see attachment) I tried entering it manually but I get the following error message:
Parse error: syntax error, unexpected 'value' (T_STRING) in C:\xampp\htdocs\StuRex.com\StuRexInsert.php on line 35
Line 35: $WAFV_Errors .= WAValidateRQ(Unique value in database . "",false,2);
Any suggestion would be appreciated.
Thank you for your attention
It looks like you are using an older version of Validation Toolkit that doesn't include the new validation option. It would be available if you upgraded to Data Bridge.
In your version you have to do it manually. You would add a recordset filtered by the unique value. Then you can use server validation on the number of rows that are returned and make sure it is less than 1, which means it doesn't already exist.
You should be able to find examples of this on our forums, or get as far as you can and post back when you have questions.
Ray:
OK. Thank you for your attention.
Ray:
I found a thread in the Webassist forums that gives rather clear instructions on how to have DW execute the Server Validation in question. I’ve tried it a couple of times and now the sequence rejects ALL ID codes that I enter.
Any suggestions will be much appreciated.
Attached please find a copy of the page in question.
BTW: The thread with the instructions is the following:
http://www.webassist.com/forums/posts.php?t=19462
Thank you for your attention
Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.
These out-of-the-box solutions provide you proven, tested applications that can be up and running now. Build a store, a gallery, or a web-based email solution.