search

Home  >  Q&A  >  body text

After obtaining the database data in thinkPHP5, the value of the drop-down box is selected by default and is passed to the background and disappears. There are pictures and codes, I hope someone can help.

After getting the data from the database, it is selected by default and I write it in two formats:

QQ截图20191004231221.jpg

QQ截图20191004231344.jpg

The ajax method is used :

QQ截图20191004231613.jpg

If I write a judgment statement, when I change the option of the drop-down box and submit it, js can get the changed data, which is the value of status and role:

QQ截图20191004231800.jpg

The following picture is the background code (part):

QQ截图20191004232305.jpg

%
3维3维1998 days ago1242

reply all(2)I'll reply

  • 3维

    3维2019-10-04 23:34:52

    I see!

    Empty defaults to 0==null, so it cannot be stored in the data array after changing it to 0. There is naturally no status value in data

    reply
    0
  • 3维

    3维2019-10-04 23:29:59

    My status clearly has a value, why is it judged as empty by empty?

    reply
    0
  • Cancelreply