Autocomplete displaying read-only field on Add Form

QuestionsAutocomplete displaying read-only field on Add Form
Michael Sheppard asked 5 years ago

Good day!

I am looking for a way to display read-only data on the Add form with an auto-complete drop-down field as the first-choice. It would need an SQL Look-up of the value. I can’t seem to find a way to do-this.

I see it working this-way.

User clicks “add” to bring-up a new record window. Clicking the first field as a drop-down / auto-complete they select a record that has a few other bits of information we need. I’d like the “Add” form to display that data as read-only data.

Any thoughts?

Thanks for any help.

 

Mike

3 Answers
Abu answered 5 years ago

You can refer demos/integration/autocomplete.php and there you can have a dropdown with force_select option to true. It will force user to select from list and not allow open text editing (line 66)

Moreover, you can connect callback function to load other fields based on this autocomplete selection. (line 72,120)

Michael Sheppard answered 5 years ago

The drop-down is not the issue – I need to load a column of read-only data using the call-back. I can get the call-back field to display if I set it to editable – but I do-not want the call-back data to be editable.

 

Thanks

 

Mike

Michael Sheppard answered 5 years ago

I have found a way to do-this with several of your other suggestions on other posts using read-only and a call-back.

However – the inline edit displays HTML code rather than a check-box. How do I fix that? The line below is what displays:

<input type=”checkbox” checked=”checked” value=”1″ offval=”no” disabled=”disabled”>

This is the configuration of the field:

$col = array();
$col[“name”] = “TEST_REQUIRED”;
$col[“align”] = “CENTER”;
$col[“formatter”] = “checkbox”;
$col[“search”] = false; //Search True/False
$col[“editoptions”] = array(“readonly”=>”readonly”, “style”=>”border:0”);
$col[“show”][“edit”] = false;
$cols[] = $col;

Your Answer

14 + 4 =

Login with your Social Id:

OR, enter

Attach code here and paste link in question.
Attach screenshot here and paste link in question.



How useful was this discussion?

Click on a star to rate it!

Average rating 0 / 5. Vote count: 0

No votes so far! Be the first to rate it.

We are sorry that this post was not useful for you!

Let us improve this post!

Tell us how we can improve this post?