douliaodun9153 2013-08-10 07:23
浏览 27

如何在PHP中检查动态创建的表单元素之间的验证?

I have an application which is divided mainly into three phases.

  • Planning
  • Implementation
  • Post-Implementation

In each of these phases there are multiple occurrences for a same activity but under different conditions. For instance, in each of these phases there will be several different meetings. Each meeting is meant to collect different data. If one meeting is intended to collect cash details, the other meeting is held to gather the information related to the progress of the project. So I have decided to provide a provision to dynamically create form & form elements. There will be a section like Create Forms in the application where some form elements will be defined. So the user can select only the required form elements necessary to create the form and save it under a name for later use. The main issue that I'm facing with such a solution is the validation between the dynamically created form fields.

ie,

Consider, there are 3 form elements. One selectbox and two textboxes namely TextboxA and TextboxB. The selectbox refers to the meeting type.

<select>
   <option value="">-- select --</option>
   <option value="1">Cash Collection</option>
   <option value="2">Progress Evaluation</option>
   .
   .
   .
</select>

In a dynamically created form how can I impose a condition like showing only the TextboxA when the meeting type Cash Collection is selected and showing both the textboxes when the meeting type Progress Evaluation is selected.

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 在获取boss直聘的聊天的时候只能获取到前40条聊天数据
    • ¥20 关于URL获取的参数,无法执行二选一查询
    • ¥15 液位控制,当液位超过高限时常开触点59闭合,直到液位低于低限时,断开
    • ¥15 marlin编译错误,如何解决?
    • ¥15 有偿四位数,节约算法和扫描算法
    • ¥15 VUE项目怎么运行,系统打不开
    • ¥50 pointpillars等目标检测算法怎么融合注意力机制
    • ¥20 Vs code Mac系统 PHP Debug调试环境配置
    • ¥60 大一项目课,微信小程序
    • ¥15 求视频摘要youtube和ovp数据集