drop down select

Questionsdrop down select
german asked 2 years ago

Hi sir,

Required message is not shown for the Drop down fields.

How to define the message .

2 Answers
Abu Ghufran answered 2 years ago


If your dropdown has empty field and you set it required, then you should see this prompt:

Code i have used here:

$col = array();
$col["title"] = "Client";
$col["name"] = "client_id";

$col["edittype"] = "select"; // render as select
$str = $g->get_dropdown_values("select distinct client_id as k, name as v from clients");

$col["editoptions"] = array("value"=>":;".$str); // <——————————— empty option here at start
$col["editrules"] = array("required"=>true); // <——————————— required to true
$col["formatter"] = "select"; // display label, not value
$cols[] = $col;

David Collett answered 2 years ago

I actually figured it out. I added this:

$col["editoptions"] = array("value"=>":;".$str);

Your Answer

10 + 16 =

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!