Autocomplete displaying read-only field on Add Form

QuestionsAutocomplete displaying read-only field on Add Form
Michael Sheppard asked 5 months 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 months 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 4 months 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 4 months 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

10 + 2 =

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 / 5. Vote count:

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

Let us improve this post!