jQuery Tokeninput add if not exists

前端 未结 8 728
野的像风
野的像风 2021-02-05 09:07

I am in the process of writing a script that builds upon user input,

I have some fields that its values need to be quired from the database,

and if no entry fo

相关标签:
8条回答
  • 2021-02-05 09:28

    In the .php file, before the while condition, you can use this:

    array_push($yourarray, array('id'=> 0 ,'name'=> $_GET["term"])); 
    
    0 讨论(0)
  • 2021-02-05 09:29

    To add to Shawn's answer (i.e. you need something server side to actually add it as a new item in the database), you might be able to make this change to allow the addition on the javascript side of things.

    0 讨论(0)
提交回复
热议问题