Preloading elements in the fabrik form

crchaves

New Member
Hello, formerly a member of Fabrik, has supported me with this query. He did the following:

insert into the cpanel 2 files

public_html/components/com_fabrik here user_ajax.php

public_html/components/com_fabrik/js here form_11.js


form_11 = Formulario mercado producto (id= 11)

attached images of the contents of the form

in the group precio producto. precio minimo, precio maximo, precio mas frecuente and observaciones, You do not need to preloaded these fields

anyone knows this and can help me, my client need to do this?

anyone know another method?

please help, we paid two months trying to figure this !

It is very important to do this preloaded elements in the fabrik form
 

Attachments

  • user_ajax.php.txt.txt
    882 bytes · Views: 225
  • form_11.js.txt.txt
    1.2 KB · Views: 188
  • 1.png
    1.png
    64.2 KB · Views: 190
  • 2.png
    2.png
    69 KB · Views: 215
  • group registro.png
    group registro.png
    42 KB · Views: 171
  • group investigador.png
    group investigador.png
    30.6 KB · Views: 188
  • group precio producto.png
    group precio producto.png
    23.4 KB · Views: 198
  • elements group1.png
    elements group1.png
    47.9 KB · Views: 190
  • elements group2.png
    elements group2.png
    48.4 KB · Views: 184
  • elements group3.png
    elements group3.png
    56.2 KB · Views: 198
  • form_11.png
    form_11.png
    21.6 KB · Views: 183
Can you describe your setup and what you are trying to do?

How do you call this form/list combination - in a Joomla article via content plugin?
When do you call it - via a menu item, a list's custom "Add" link, some other custom link?

Is the form belonging to the list (e.g. a form to create a new record in the list displayed below) or is it a search form (to filter the list)?

From your description I assume it's for creating a new record which should be pre-populated with some of the elements the logged-in user has set in his "last" record - is this correct?
 
How do I get at the site? The only credentials in your "My Sites" don't get through the initial htaccess challenge.

-- hugh
 
Thanks for your answers

Troester : From your description I assume it's for creating a new record which should be pre-populated with some of the elements the logged-in user has set in his "last" record - is this correct?

Yes, insert a new record and when I save that record must be preloaded

Is this possible?
 
The access you need, is the front end and back end?

no problem if I put the access here?

Thanks !
 
I already upgraded my site and creditals, if you can not get in, my hosting provider blocks some IP for not being Spanish speakers.

what is your IP ?
 
S.O.S !!!!!
Please I need your Help!!!
I already upgraded my site and creditals, if you can not get in, my hosting provider blocks some IP for not being Spanish speakers.

what is your IP ?
 
In new records elements can be pre-populated with the "Default" setting, you can use php code with "eval"=yes.
Or you can add a form php plugin running "On" = "new" with Process script "onLoad"
Code something like
Code:
$db =JFactory::getDbo();
$query = $db->getQuery(true);
 
// select maximum ROW ID (is it id_merca_produ?) from your MERCADOR IDs - this should be ID of user when he loggs in (is this id_mercado?)
$lrow = '{$my->id}'; //the Joomla userID of the logged-in user
 
$query = "SELECT MAX(`id_merca_produ`) FROM `merca_produ` WHERE `id_mercado`=$lrow LIMIT 1";
$db->setQuery($query);
$thatRow = $db->loadResult();
 
// values are ordered the same as they are loaded in your form
$query = $db->getQuery(true);
$query = "SELECT `id_tip_mercado`, `id_mercado`, `id_producto`, `nom_variedad`, `id_origen`, `nom_uni_venta` FROM `merca_produ` WHERE `id_merca_produ`=$thatRow LIMIT 1";
$db->setQuery($query);
$myrow = $db->loadObject();
 
//preload your elements
$formModel->data['merca_produ___id_tip_mercado']=$myrow->id_tip_mercado;
//etc

I don't understand why you are using UserAjax and JS.
 
Thank you for your support.

userajax.php and form_11.js the files were for the help of another person. If there is an option that works, I remove these files.

What I recommended to preload the form elements?
 
If you have multiple elements to preload I would use the php plugin.
Otherwise you'll have to repeat the queries in every default setting.
 
Thank you for your support.

You could tell me where is php plugin?
Can you make an example?

I would appreciate it very much

Regards !
 
Hello, I saw my last post???

I have another question. In Frabrik elements.

You can display a user group created in Joomla?

currently it is showing all users.

Any method for this?
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top