Using tags from array example

QuestionsUsing tags from array example
C3media asked 7 years ago

Hello,

There is a way to use tags based in array values non using DB?

Thank you!

5 Answers
Abu Ghufran answered 7 years ago

Hi,

Yes, instead of following lines:
$str = $g->get_dropdown_values("select distinct client_id as k, name as v from clients");
$col["editoptions"] = array("value"=>$str);

You can hardcode or fill $str with array. The format of $str is key:val; key:val; key:val …..
e.g.
$col["editoptions"] = array("value"=>'10:$10;20:$20;30:$30;40:$40;50:$50');

C3media answered 7 years ago

Ok Abu…

Thank you,

However I was trying to insert using example Select2 Tag, but give me this issue:

Couldn't execute query. Field 'client_id' doesn't have a default value – INSERT INTO invheader (`ship_via`,`invdate`,`amount`,`note`) VALUES ('5','2017-04-12','6676767','fgfg')

There is a way to resolve it?

Thank you!

Abu Ghufran answered 7 years ago

The demo was intended to show multiple tag selection.
The selected values will be posted as comma sep value.

It may have insertion issue. I'll review and update the demo code.

C3media answered 7 years ago

Hello,

Thare are notice about this issue inserting using Tag it?

Thank you!

Abu Ghufran answered 7 years ago

I am unable to understand the issue.
Please send details of error messages / screenshot.

Your Answer

12 + 9 =

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?