Forums

How to show the right record by a Form

bbsagency 05 Jul, 2010
Hi all,
I use chronoforms to create by an administrator a new user and to fill a table including other data about that user.
The relation between the _users table and the table containing the other data is the username.

When the user will access, he should have the option to acces to these data and to change them.
I created a from for the user, related to the table, by which the user can change the its own data.

I have a menu where there is an item redirecting to the Form to edit the data, but I would like that the user will see the Form cntaining the data.

How can I redirect to the right data? I mean, how can I specivy on the URL the request for the current username?
I would like to use the Profile Plugin to specify the "username", but how can I specify this value that is dynamic?

Thank to all!
GreyHead 07 Jul, 2010
Hi bbsagency ,

The user_id is a better user identifier than the username (though if you have one you can easily get the other).

Add a parameter to the link you use &username=greyhead and tell the Profile Plugin which database column to look for this in.

Bob
bbsagency 15 Jul, 2010
Hi Bob,
thank you for your help.
I have the link to the Form on a menu, so how can I specify the &username=... parameter on it?
Thank you!
Cheers,
Giuseppe
GreyHead 17 Jul, 2010
Hi Giuseppe,

I'm confused. If the user is logged in then you can always find their id and username. The Profile plugin will use the User ID if you don't specify anything else.

Bob
bbsagency 19 Jul, 2010
Hi Bob,
sorry if I confuse you, maybe I'm not enough expert on Joomla environment yet...
Anyway, my problem is that I have created a table containing other info about the user, and this table is linked to the _users table through the username.
So, I have thought that to show the data of the correct record on the form, I have to specify the username parameter on the profile page.
I would like to put some like this:

- as 'Request' parameter name : username

- as Default Request Parameter value : <?=$user->username?>

Maybe it is not the right way....
Thanks!
Regards,

Giuseppe
GreyHead 19 Jul, 2010
Hi Giuseppe,

It is always better to link with the User ID and not the user name as the ID won't change but the Username might.

- as 'Request' parameter name : username


Yes

- as Default Request Parameter value : <?=$user->username?>


No leave this blank.


Bob
bbsagency 19 Jul, 2010
Hi Bob,
thank you for your help.
I have added an user_id field to my table, and I have specified as 'Request' parameter name : id.

I have left blank the Default Request Parameter value.

Then I have set the Target field name to the new added table field.

But when I open the Form (connected to the table), all fields are shown blank...

The link to the form is on a menu, where the Form is called through it's name.

Maybe I have to set some other things?

Regards,
giuseppe
bbsagency 23 Jul, 2010
Hi all,
I haven't yet solved my problem....
Someone could suggest me the right way? Maybe I have to add some php code on the HTML code?
Thank you
GreyHead 29 Aug, 2010
Hi bbsagency,

I noticed that I never replied to your last question, sorry.

Probably too late now but for your info, and other readers, there is recipe on this in Chapter 11 of the ChronoForms Book.

Bob
tcole 30 Aug, 2010
Bob,
I have just ordered the book.
Thanks for the heads up on this.

Cheers
This topic is locked and no more replies can be posted.