This topic is locked
[SOLVED]

 Read-Only Drop-Down List

4/17/2013 10:32:05 PM
PHPRunner General questions
D
dkasing author

I would like to create a read-only drop-down list so that users can see only one selection from the look-up table. I have tried setting the field attribute to read-only but this doesn't seem to work. Any ideas?
Thank you.
Sincerely,

Douglas

Admin 4/18/2013

I'm not really sure what readonly dropdown list is. Probably is can simple set 'Edit as' of this type to readonly?

D
dkasing author 4/20/2013



I'm not really sure what readonly dropdown list is. Probably is can simple set 'Edit as' of this type to readonly?


Dear Sergey:

Sorry let me clarify. I am trying to display a field in a list in which the field value is replaced with a value looked up from another table. I can do this using the lookup wizard, but then I have an editable drop-down list field. I would like to make this looked-up value read-only.
If I set the edit type to read-only, I can no longer take advantage of the look-up wizard (unless I am doing this wrong).
I could accomplish a similar result with a join in the initial query, but in this case, I am using system variables to limit the list selection so it is difficult to use a join.
Please let me know if this is clearer.
Thank you.
Sincerely,

Douglas

Admin 4/20/2013

I see, this makes sense.
A few ideas are listed here:

http://stackoverflow.com/questions/11976348/a-readonly-equivalent-for-html-select-elements
Something like this in Javascript OnLoad event will work, just put correct element ID there:

$('#input_id').disabled();
W
wildwally 4/21/2013

I had a simialar issue where I wanted a drop down field to be read only on an edit page. I tried using the javascript method to accomplish this by setting/enabling the makereadonly on the field. However, in doing so the lookup fileds with dependenicies will no longer work, plus the read only fields turn to a light gray color that even after many attempts to manipulate I just could not override PHPR.
So what I ended up doing was creating a couple of handful of temporary session variables in the events before process. Then using php snippet I echo the session variable in the place of the dropdown field and/or the read only fields. When the user saves the changes I unset the temporary sessions and if the user selects the custom back to list button it also unsets the temporary sessions.
Hope this is of some help, if you find a better way to do things please share.