drop down select

Questionsdrop down select
german asked 7 years ago

Hi sir,

Required message is not shown for the Drop down fields.

How to define the message .

2 Answers
Abu Ghufran answered 7 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 7 years ago

I actually figured it out. I added this:

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

Your Answer

16 + 3 =

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?