I am using v2.3 of chronoforms.When i am creating a new form and connect it to a table,before the connection i have to do "create table".When i create the table there are already some options like recordtime,uid,cf_user_id e.t.c
My question is how can i make it so the form saves the cf_user_id as id.To fully understand,what i want to do is when the user fills in the form i want to take his id and store it in the table under a field with name "id" and not "cf_user_id"
My question is how can i make it so the form saves the cf_user_id as id.To fully understand,what i want to do is when the user fills in the form i want to take his id and store it in the table under a field with name "id" and not "cf_user_id"
Hi otinane,
Add an id column in the table with Type Integer.
Make sure that the User id is in $form->data['id'] Adding this in a Custom Code element will do it
Bob
Add an id column in the table with Type Integer.
Make sure that the User id is in $form->data['id'] Adding this in a Custom Code element will do it
<?php
$user =& JFactory::getUser();
$form->data['id'] = $user->id;
?>Bob
Hi otinane,
Sorry, In ChronoForms 2.3 I'm not sure. In 3.2 it would be
Bob
Sorry, In ChronoForms 2.3 I'm not sure. In 3.2 it would be
<?php
$user =& JFactory::getUser();
JRequest::setVar('id', $user->id);
?>In the OnSubmit Before Email box.Bob
I have been using this in a v4 form, and it have worked very well until last update to latest v4 rc2.0 and joomla 1.7.
Since the last update it stopped working and I only get a blank space where the data should be. Is something changed so I have to change the code to get my data?
//Anna
Since the last update it stopped working and I only get a blank space where the data should be. Is something changed so I have to change the code to get my data?
//Anna
Hi Anna,
In ChronoForms v4 it would be
Bob
In ChronoForms v4 it would be
<?php
$user =& JFactory::getUser();
$form->data['id'] = $user->id;
?>Bob
This topic is locked and no more replies can be posted.
