I've spent hours trying to get this working and I'm hoping someone can help me out here. I'm using the version 4 on Joomla 1.6.
Goal:
1) I want a form with four fields that saves to a database. It's only accessible for logged in users.
2) I want the user to send form to database as a new record, if one doesn't already exist for this user.
3) If a record already exists for this user, I want the form to populate with the database record (all four fields) for the logged in user.
4) I want the user to be able to edit or change the fields in the form and then save form, which then updates record in database. But not create a new record.
I've got the table setup and the form does save it to the table. But it creates a new record every time the user submits form. I don't know how to just modify an existing record.
Thank you for your help.๐
Goal:
1) I want a form with four fields that saves to a database. It's only accessible for logged in users.
2) I want the user to send form to database as a new record, if one doesn't already exist for this user.
3) If a record already exists for this user, I want the form to populate with the database record (all four fields) for the logged in user.
4) I want the user to be able to edit or change the fields in the form and then save form, which then updates record in database. But not create a new record.
I've got the table setup and the form does save it to the table. But it creates a new record every time the user submits form. I don't know how to just modify an existing record.
Thank you for your help.๐
Hi vkeys,
Include the primary key value of the current record as a hidden input in your form.
Bob
Include the primary key value of the current record as a hidden input in your form.
Bob
Hi Bob,
I'm not very bright on some things๐
Should I add a 'hidden box' to my form and then add cf_id to the 'Field default value'?
Thank you,
Don
I'm not very bright on some things๐
Should I add a 'hidden box' to my form and then add cf_id to the 'Field default value'?
Thank you,
Don
So far, to no avail.
I added {cf_id} to the 'Field default value' and when I hit submit, it just creates a new record. This form has On Load -> DB Record Loader and it loads the user's first record. But creates new ones๐
Attached are my settings for DB Record Loader. Can you help me with these? Maybe this is my problem.
Thanks,
Don
[attachment=1]Image1.jpg[/attachment]
[attachment=0]Image2.jpg[/attachment]
I added {cf_id} to the 'Field default value' and when I hit submit, it just creates a new record. This form has On Load -> DB Record Loader and it loads the user's first record. But creates new ones๐
Attached are my settings for DB Record Loader. Can you help me with these? Maybe this is my problem.
Thanks,
Don
[attachment=1]Image1.jpg[/attachment]
[attachment=0]Image2.jpg[/attachment]
Hi vkeys,
Please try leaving the default value blank; and make sure that the input name is cf_id.
Bob
Please try leaving the default value blank; and make sure that the input name is cf_id.
Bob
Hi Bob,
I just did your suggestion and, unfortunately, it still creates a new record.
Field Id: cf_id
Field default value: blank
I just did your suggestion and, unfortunately, it still creates a new record.
Field Id: cf_id
Field default value: blank
This topic is locked and no more replies can be posted.