Field value is not shown in View mode

4 posts by 2 authors in: Forums > CMS Builder
Last Post: July 19, 2019   (RSS)

By andreasml - July 16, 2019

Hi

I have given the following default value for a certain field ("treating_physician"):

<?php echo $CURRENT_USER['fullname'] . " " . $CURRENT_USER['firstname']  ; ?>

The type of field is a list field and the possible options in the list are taken from the following script:

SELECT CONCAT (fullname, " ", firstname)
  FROM `<?php echo $TABLE_PREFIX ?>accounts`
  WHERE hospital='<?php echo $CURRENT_USER['hospital'] ; ?>'
  ORDER BY fullname

So far it works great. However, I just noticed that in the View mode of the record, there value on the field "Treating physician" is not shown although it does exist in the Edit mode.

On the contrary, if I choose the type of field as text field instead of list (using the same default value as shown before), the value of the "Treating physician" is shown in the View mode as well in the Edit mode.

As I want users to be able to choose only from a specific list of names the value for the treating_physician field, I wouldn't like to change the list type to the text field type. 

I am not quite sure what I am doing wrong.

Kind regards,

Andreas Lazaris 

By andreasml - July 18, 2019

Hi

I have completed a second-level request

Regards

Andreas

By gregThomas - July 19, 2019

Thanks, Andreas, I've responded to the request. Let me know if you've got any questions.

Greg Thomas







PHP Programmer - interactivetools.com