简体   繁体   English

更新选择的内容而无需重新加载表格

[英]Update select contents without reloading form

I have quite a long form which has many HTML form selects pulling data from MySQL tables - quite often a client will be mid way through filling in the form when they realise that the value they want for department, for example, has not yet been entered into the system so is not in the list. 我有一个很长的表格,其中有许多HTML表格可以选择从MySQL表中提取数据-例如,当客户意识到尚未输入部门所需的值时,通常会在填写表格的过程中进入系统,因此不在列表中。

I have added a link to a simplified popup for adding departments but after it is added it does not appear in the select list as the contents of that select are based on what was available on the load of the page when the initial query ran - how can I get the select to update without having to submit and then edit, without the page refreshing/reloading and without the client losing the data they have currently added? 我已经添加了一个指向简化的弹出窗口的链接,用于添加部门,但是添加后它不会出现在选择列表中,因为该选择的内容基于初始查询运行时页面加载时可用的内容-如何我可以选择更新而无需提交然后进行编辑,无需刷新/重新加载页面,也不会丢失客户端当前已添加的数据吗?

Thanks 谢谢

Did read what you are asking, since its too long) But did you try javascript? 读了什么,因为它太长了?)但是您尝试使用javascript吗? changing form values after paged loaded is possible only with javascript. 分页加载后只能使用javascript更改表单值。

在该弹出窗口上提交表单时,将其与ajax一起保存在数据库中,并作为响应获取插入的数据...然后在ajax成功的情况下,在select中添加新选项(带有返回的数据)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM