douluan8828 2011-07-25 14:50
浏览 58
已采纳

使用javascript生成表单元素并将它们发布到php可以在EI中使用,而不是在Chrome和Firefox中

I can't get my head around this problem. I have a page on which there is a form generated by php. Then I'm using Javascript to track number of selected checkboxes and in a real time generating a text with this information as well hidden input with this very same value I tried to use both jQuery and raw Javascript.

var message=first+'<input name="first_credit" type="hidden" value="'+first+'"/>';

$('#render_second').html(message).show();
document.getElementById('render_second').innerHTML = message;    

The value that is stored in variable first gets displayed correctly in all browsers, but when I post the form only in EI I get the value of first_credit. In FireFox and Chrome its as if that hidden element is not a part of form.

Thank you for your time chaps.

And here is the solution ... I opened the table tag, then the form opening tag and then trs and tds one of which contained the div in to which I was rendering the input field. All I did is, first open the form tag and then table tag and it all works fine :-) Sorry to waste your time folks...

  • 写回答

1条回答 默认 最新

  • dtg25862 2011-07-27 00:35
    关注

    And here is the solution ... I opened the table tag, then the form opening tag and then trs and tds one of witch contained the div in to witch I was rendering the input field. All I did is, first open the form tag and then table tag and it all works fine :-) Sory to waste your time folks...

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥30 求一段fortran代码用IVF编译运行的结果
  • ¥15 深度学习根据CNN网络模型,搭建BP模型并训练MNIST数据集
  • ¥15 lammps拉伸应力应变曲线分析
  • ¥15 C++ 头文件/宏冲突问题解决
  • ¥15 用comsol模拟大气湍流通过底部加热(温度不同)的腔体
  • ¥50 安卓adb backup备份子用户应用数据失败
  • ¥20 有人能用聚类分析帮我分析一下文本内容嘛
  • ¥15 请问Lammps做复合材料拉伸模拟,应力应变曲线问题
  • ¥30 python代码,帮调试,帮帮忙吧
  • ¥15 #MATLAB仿真#车辆换道路径规划