| Support Center

(Back to Website)

Support Center

Name is required.
Email address is required.
Invalid email address
Answer is required.
Exceeding max length of 5KB

drop down select

germanmary Oct 04, 2017 10:05AM PKT

Hi sir,

Required message is not shown for the Drop down fields.

How to define the message .

Up -2 rated Down
Abu Ghufran Oct 05, 2017 08:21AM PKT PHP Grid - Support Center Engineer

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;
Up 0 rated Down
David Hamel Jan 16, 2018 03:42AM PKT
I actually figured it out. I added this:

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

Post Your Public Answer

Your name (required)
Your email address (required)
Answer (required)

Contact Us

  • Post a Public Question
  • Email Us
  • Live Chat!
  • Ask the Community


    • Paste complete code that is involved in your question. You can use pastebin.com to share code link.

    Screenshots or Online link of webpage is helpful in resolution. You can also send email at address mentioned below.

    • To report an issue, Write steps to regenerate the case.

    • For email support or live chat, Use gridphp@gmail.com and add it in Google Chat.
seconds ago
a minute ago
minutes ago
an hour ago
hours ago
a day ago
days ago
Invalid characters found