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

Hello,

If your dropdown has empty field and you set it required, then you should see this prompt:
http://prntscr.com/gtfo8r

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 1 year ago

I actually figured it out. I added this:

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

Your Answer

13 + 15 =

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:

As you found this post useful...

Follow us on social media!

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

Let us improve this post!