Hi,
I want to prevent a value from being stored twice in the database table.
I have created a switch:
name: check_species_duplicate
data provider: {var / empty: save_beob_new.row.Fund.species}
values: true: {error: type already exists} {redirect: index}
My save data function (name: save_beob_new) is in the event: save_new_beob
{fn: check_species_duplicate}
{fn: save_beob_new}
{Redirect: index}
The problem is that now I always get the error message and no new record is saved.
The new record comes from a form
name: beob_new_form
data provider: {var: read_beobs}
There is also a drop-down box in the form, which gives the value necessary for the duplicate check:
name: species
Name: Fund [species]
Option:
= Select type
{var: read_specieslist}
Unfortunately, I could not solve the problem.
Maybe it's easier in the event: save_new_beob using a PHP or Javascript for the check.
Or you have to set a click event for the duplicate check in the form: species submit button?
Thanx
F.
I want to prevent a value from being stored twice in the database table.
I have created a switch:
name: check_species_duplicate
data provider: {var / empty: save_beob_new.row.Fund.species}
values: true: {error: type already exists} {redirect: index}
My save data function (name: save_beob_new) is in the event: save_new_beob
{fn: check_species_duplicate}
{fn: save_beob_new}
{Redirect: index}
The problem is that now I always get the error message and no new record is saved.
The new record comes from a form
name: beob_new_form
data provider: {var: read_beobs}
There is also a drop-down box in the form, which gives the value necessary for the duplicate check:
name: species
Name: Fund [species]
Option:
= Select type
{var: read_specieslist}
Unfortunately, I could not solve the problem.
Maybe it's easier in the event: save_new_beob using a PHP or Javascript for the check.
Or you have to set a click event for the duplicate check in the form: species submit button?
Thanx
F.