dsl36367 2014-04-24 08:37
浏览 41
已采纳

用户输入字段可以更好地使用DIV或仅计算公式的网页表单? [关闭]

I want to have 6 input fields in a webpage. If the user presses a button the 6 fields expand to 7,8, 9, or 10 fields. The fields are editable and come with a preset value. With the input from the user (or the preset values) a final value is calculated via a formula.

  1. Is it better to use a form for the fields or DIVs?
  2. Should I use JavaScript or something else I am not thinking about yet?
  3. Should I use AJAX when getting the values or is it not needed in this case?
  4. I thought about using an excel like editor made with jQuery https://github.com/mleibman/SlickGrid/wiki/Examples but it seems overkill for my needs plus I would need to edit a lot of it since I want a simple display of the fields.
  • 写回答

1条回答 默认 最新

  • donglin6659 2014-04-24 08:47
    关注

    I would use a form as you're asking the users for their data to be input. This will also trigger the keyboard on mobile/tablet devices if you're also targeting those platforms.

    Javascript is fine for this, unless you want to hide the formula you're using (as they will be able to see it if they view your source).

    Do you need to use AJAX? Are the pre-populated values going to change that much? If not, then no, it's just adding extra work when you could just have an array of values.

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

报告相同问题?

悬赏问题

  • ¥15 c语言怎么用printf(“\b \b”)与getch()实现黑框里写入与删除?
  • ¥20 怎么用dlib库的算法识别小麦病虫害
  • ¥15 华为ensp模拟器中S5700交换机在配置过程中老是反复重启
  • ¥15 java写代码遇到问题,求帮助
  • ¥15 uniapp uview http 如何实现统一的请求异常信息提示?
  • ¥15 有了解d3和topogram.js库的吗?有偿请教
  • ¥100 任意维数的K均值聚类
  • ¥15 stamps做sbas-insar,时序沉降图怎么画
  • ¥15 买了个传感器,根据商家发的代码和步骤使用但是代码报错了不会改,有没有人可以看看
  • ¥15 关于#Java#的问题,如何解决?