You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何实现表单指定值联动自动填充?是否需创建事件?

表单字段联动自动填充的实现方案

是否需要创建事件?

这得看你使用的表单平台:

  • 要是用SharePoint、Power Apps这类低代码平台,基本不用手动创建复杂事件,靠内置功能就能搞定:
    • SharePoint列表:可以用列表验证规则,或者搭建Power Automate流——当[Nom Entreprise]字段值变化时,自动更新[Candidats Potentiels]字段;也能在表单编辑界面给目标字段设置带条件的默认值。
    • Power Apps:直接给[Nom Entreprise]控件的OnChange属性添加逻辑即可,比如:
      If(Self.Selected.Value = "Recrutement", UpdateContext({candidatVal: "Recrutement"}))
      
      再把[Candidats Potentiels]字段的默认值设为candidatVal。
  • 如果是自定义开发的HTML/JS表单,那就得靠事件监听实现:监听[Nom Entreprise]字段的change事件,判断值符合条件时填充目标字段,示例代码:
    document.querySelector('[name="Nom Entreprise"]').addEventListener('change', function() {
      if (this.value === 'Recrutement') {
        document.querySelector('[name="Candidats Potentiels"]').value = 'Recrutement';
      }
    });
    

从你提供的截图(法语字段+类似SharePoint的界面)来看,优先用平台自带的自动化规则或Power Automate来实现,不用编写复杂代码,操作简单还易维护。

内容的提问来源于stack exchange,提问作者Kais

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.18 13:45:37