could someone help me on how to proceed if i want to load a field value from a user.profile i created in joomla. so the table name is itocj_user_profiles. the profile is a custom profile and not the default one. so i got my own fields in there.
Forums
load databse and access fields from within a form
Hi arevivo ,
You can use a DB Record Loader action to get the profile record.
Bob
You can use a DB Record Loader action to get the profile record.
Bob
i am trying to that but i probably don't get it.
so here is what i have configured.
DB Field : cf_uid
Table: itocj_user_profiles
so here is what i have configured.
DB Field : cf_uid
Table: itocj_user_profiles
Hi arevivo,
Sorry, there's nothing more I can tell you from the data here.
Bob
Sorry, there's nothing more I can tell you from the data here.
Bob
sorry for that i replied before finishing.
Here i go ;
DB Field: cf_uid
Table: itocj_user_profiles
request param: 'i dont know if i need to use that'
Load Field: yes
WHERE: profile5.clientnumber, profile.value from itocj_user_profiles where id = cf_uid
MY FORM HAVE THIS
<div class="ccms_form_element cfdiv_text" id="label_text_container_div">
<label>Label Text</label>
<input maxlength="150" size="30" class="" title="" label_over="0" hide_label="0"
type="text" name="profile5.clientnumber" />
<div class="clear"></div>
<div id="error-message-profile5.clientnumber"></div>
</div>
i am trying to load the value in profile5.clientnumber into the input field
Here i go ;
DB Field: cf_uid
Table: itocj_user_profiles
request param: 'i dont know if i need to use that'
Load Field: yes
WHERE: profile5.clientnumber, profile.value from itocj_user_profiles where id = cf_uid
MY FORM HAVE THIS
<div class="ccms_form_element cfdiv_text" id="label_text_container_div">
<label>Label Text</label>
<input maxlength="150" size="30" class="" title="" label_over="0" hide_label="0"
type="text" name="profile5.clientnumber" />
<div class="clear"></div>
<div id="error-message-profile5.clientnumber"></div>
</div>
i am trying to load the value in profile5.clientnumber into the input field
Hi arevivo,
You don't need the WHERE code at all if you use the Request Paramter to tell the Record Loader which record to load. It should presumably be cf_uid.
Bob
PS The WHERE box *only* takes the WHERE clause and the notes say "don't use the WHERE word."
You don't need the WHERE code at all if you use the Request Paramter to tell the Record Loader which record to load. It should presumably be cf_uid.
Bob
PS The WHERE box *only* takes the WHERE clause and the notes say "don't use the WHERE word."
i cant really get it. so what i want to do is just have the id of the user currently logged in.
DB Record Loader
--------------------
DB Field: id
Table: itocj_users
the rest is default
FORM
---------------------
<table border="0" width="370px" bordercolor="#FFFFFF">
<tr>
<td>Email</td>
<td class="ccms_form_element cfdiv_text" id="label_text_container_div">
<input style="border: none;" maxlength="150" size="30px" class="" title="" label_over="0"
hide_label="0" type="text" value="" name="id" />
</td>
</tr>
</table>
When i front end view the form i dont see anything
DB Record Loader
--------------------
DB Field: id
Table: itocj_users
the rest is default
FORM
---------------------
<table border="0" width="370px" bordercolor="#FFFFFF">
<tr>
<td>Email</td>
<td class="ccms_form_element cfdiv_text" id="label_text_container_div">
<input style="border: none;" maxlength="150" size="30px" class="" title="" label_over="0"
hide_label="0" type="text" value="" name="id" />
</td>
</tr>
</table>
When i front end view the form i dont see anything
Hi arevivo,
I think you need to have the Request Param in the URL that calls the form e.g. cf_uid=999 or you need to add it to the $form->data array before the action runs. You can do this with a Custom Code action
Bob
I think you need to have the Request Param in the URL that calls the form e.g. cf_uid=999 or you need to add it to the $form->data array before the action runs. You can do this with a Custom Code action
<?php
$user =& JFactory::getDBO();
$form->data['cf_uid'] = $user->id;
?>
Bob
This topic is locked and no more replies can be posted.