Hi,
First of all, excuse me for my English.
I allow myself to ask because I did not find the answer to my question on the forum.
Here is my problem :
In a registration form for a competition, 2 players must enter their license number.
If these players entered their numbers liecence always in the same order, it would not be a problem since I would create a unique key (combination of 2 license numbers).
The problem is that we do not know in which order they will enter the players and because of this, impossible to create a combined key with 2 fields since if player 1 -> lience = 1111 and player 2 -> license = 2222
we would have either the key "11112222" or "22221111".
My question is :
How to check in a form chronoforms when the registration will be sent, if a player is already registered and how to return a message indicating that the registration is not taken into account since the player 1 or the player 2 is already registered ? (The player's license already exists in the database).
Thank you for your reply.
Fabrice
Belgium
First of all, excuse me for my English.
I allow myself to ask because I did not find the answer to my question on the forum.
Here is my problem :
In a registration form for a competition, 2 players must enter their license number.
If these players entered their numbers liecence always in the same order, it would not be a problem since I would create a unique key (combination of 2 license numbers).
The problem is that we do not know in which order they will enter the players and because of this, impossible to create a combined key with 2 fields since if player 1 -> lience = 1111 and player 2 -> license = 2222
we would have either the key "11112222" or "22221111".
My question is :
How to check in a form chronoforms when the registration will be sent, if a player is already registered and how to return a message indicating that the registration is not taken into account since the player 1 or the player 2 is already registered ? (The player's license already exists in the database).
Thank you for your reply.
Fabrice
Belgium
Hi Fabrice,
There is a "Read data" action which you can use to read from a database table based on some conditions, if a record is found you can display a message and stop the form processing.
Best regards
There is a "Read data" action which you can use to read from a database table based on some conditions, if a record is found you can display a message and stop the form processing.
Best regards
Thank you for your quick reply.
However, I have tested this option and apparently you can test a condition against a value.
How to test if the license fields of player 1 or license of player 2 entered in the form already exist in the database, then do not save the record.
However, I have tested this option and apparently you can test a condition against a value.
How to test if the license fields of player 1 or license of player 2 entered in the form already exist in the database, then do not save the record.
Well it would be
{data:licence1}{data:licence2} OR {data:licence2}{data:licence1}
{data:licence1}{data:licence2} OR {data:licence2}{data:licence1}
Thank you for the help and I understood that but my problem is to build the instruction that tells me:
if the value entered in the form with {data: license1} OR {data: license2} already exists in the table
then do not take the registration into account.
Fabrice
if the value entered in the form with {data: license1} OR {data: license2} already exists in the table
then do not take the registration into account.
Fabrice
In the Found event of the read data put an error message and an event load.
You want to cancel saving of both of them or of the existing player only ?
The 2 players are part of the same record and if one of them already exists in the database,
the form that is filled must not be registered in the database and a message informing the user must appear. Thank you for your help.
Then you need a "Read data" and add 2 conditions with OR parameter between them:
Best regards
license_field = {data:license1}And in the "found" event you can add, first a message action to display an error then an "Event loader" to reload the form
OR
license_field = {data:license2}
Best regards
Despite having set the condition and the license number already exists, the record is added to the database. I attached to this message the screenshot of the Read Data in my form.
What did you put in the "found" event for that read data action?
And what else? Did you put an event load in there to go back to your load event if there's an error?
I do not understand what you mean. I just want the data entered on the form not to be saved in the database
if one of the two licenses exists. Once again, thank you for your precious help.
if one of the two licenses exists. Once again, thank you for your precious help.
OK so you need to put an EVENT LOAD action after the error message, to tell it to go back to the previous page if there's an error.
OR if you still want everything else in your submit event to happen, then put your save data action inside the "not found" event of your read data action.
OR if you still want everything else in your submit event to happen, then put your save data action inside the "not found" event of your read data action.
How did you translate all the interface ? that may have broken some features because not all strings can be changed!
This topic is locked and no more replies can be posted.