iBib Posted April 24, 2002 Posted April 24, 2002 I have to validate a field in a form, I beleive that my problem is not solvable with Javascript. The form is a competition which all entrants only can apply once. And the only workable solution to that is to make sure that people can't enter with the same e-mail address twice. The form and format page have to check if someone tries to enter the competition twice (or more) with the same e-mail address. I have javascript validation on all the required fields (such as name, phone ...) and I've tried to use the FMP control attributes on fields (such as: required value, not-empty and so on). But all that happens is that I can get the format page use the error code sent out by WC (code 504) and print: "You have already answered... you bastard", but the information with the same e-mail address is added to the database. The only difference is that it doesn't contain the duplicate e-mail address. Is there anyway I can stop FMP from adding that post?
Garry Claridge Posted April 24, 2002 Posted April 24, 2002 You can apply a 'Unique' validation in 'Define Fields' for the email field. When a duplicate is submitted and error will be returned. Hope this helps. Garry
evildan Posted April 25, 2002 Posted April 25, 2002 Gary, Won't that hang the server? I thought they popped up an error message on the server and hung there until someone clicked okay. That being an os9.x server of course. Does this still happen in Unlimited?
Garry Claridge Posted April 25, 2002 Posted April 25, 2002 Dan, It shouldn't pop-up on the server if you are using WebCompanion (cdml). The error will be sent to the browser. Hence, you will be able to capture this with "-error". Hope this helps. Garry
Keith M. Davie Posted April 26, 2002 Posted April 26, 2002 FWIW, I just tested this concept on Internet Explorer. My -error page was not returned. Instead I got a pop-up window "Internet Explorer Script Alert" which had the message, "Your attempt to edit a record failed because of the following: "Not unique value on field "expire" "
Garry Claridge Posted April 26, 2002 Posted April 26, 2002 I've just had a chance to do my own test with: <form action="FMPro" method="post"> <input type="hidden" name="-db" value="combotest.fp5"> <input type="hidden" name="-lay" value="web"> <input type="hidden" name="-format" value="hworld2.html"> <input type="hidden" name="-error" value="fmperror.html"> <input type="hidden" name="-recid" value="[FMP-CurrentRecID]"> Field b1: <input type="text" name="my_rec_serial#" value="[FMP-Field: my_rec_serial#]"> <input type="submit" name="-edit" value="Edit"></form> Here is the fmperror.html contents: </head> <body> Error [FMP-CurrentError] </body> It is working OK for me; it returns error code 504. I am using FMP 5.5v2 on Mac OS X. All the best. Garry
iBib Posted May 15, 2002 Author Posted May 15, 2002 It works great with [FMP-CurrentError] and som If-statements. thx
Recommended Posts
This topic is 8297 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now