[SOLVED] How get "read only" a databasejoin element?

I need "read only" a databasejoin element.

There isn't a "read only" flag, so I set
1.png


But, if I need the value to use it in JS
Code:
if (typeof stato_preesistente_in_db === 'undefined')
  {stato_preesistente_in_db = Fabrik.getBlock('form_97').elements.get('fabrik_nominativi___Stato_Simpatizzante_Socio').getValue();}

I get the label, not the value.

If I use
Fabrik.getBlock('form_97').elements.get('fabrik_nominativi___Stato_Simpatizzante_Socio_raw').getValue();​
I get an error: "TypeError: Cannot read property 'getValue' of null"


If I set
2.png

Fabrik.getBlock('form_97').elements.get('fabrik_nominativi___Stato_Simpatizzante_Socio').getValue();​
give me the right value ("2"), but obviously it isn't read only.
 
I tried to work-around.

1- I set "Stato_Simpatizzante_Socio":
index.php




2 - I added a calc element "Visualizza_Stato_Simpatizzante_Socio" to display-only the text of "Stato_Simpatizzante_Socio"

3.png



but it doesn't work: it displays blank.

???
 
fabrik_nominativi___Stato_Simpatizzante_Socio is a HTML id, there's no _raw.

Whereas the placeholder used in calc is nominativi___Stato_Simpatizzante_Socio resp. nominativi___Stato_Simpatizzante_Socio_raw.
You should always quote a placeholder to avoid php errors if it's empty - which will produce a blank page.

So try with calc
return '{nominativi___Stato_Simpatizzante_Socio_raw}';
 
I tried
return '{nominativi___Stato_Simpatizzante_Socio}';​
It works.
I'm sorry: I am stupid!.

But, I am obliged to use 2 elements.

Why happens what I wrote in my first post?
I use

index.php


for other elements, and it works...
 
I think a readonly dbjoin doesn't contain the value in the page source, it's only displaying the label.
 
We are in need of some funding.
More details.

Thank you.

Members online

No members online now.
Back
Top