English 中文(简体)
提交残疾领域的最佳方法?
原标题:Best method for submitting disabled form fields in jQuery?

似乎有几种方式可以提出残疾领域:

  • Have a hidden field that changes when the input changes, and submit that
  • Manually append the key/value pairs upon submission
  • Revert values on the server-side (only if values not expected to change)

我很想知道(如果有的话)提交残疾形式领域的最佳做法是什么。 显然,<条码>可在上查阅,这是现有的最佳选择,但我已经核对了我即使残疾(由于商业逻辑)也需要提交的盒子。 我认识到,这不是理想的情况,但很少是网络发展的情况。

是否有提交残疾成分的最佳做法?

最佳回答

最好的选择是只读投入——为简单回报不实的检查箱制造一个点击事件,并改变其背景。

没有任何最佳做法,但需要的是最小的ging。

问题回答

A fourth solution would be to enable the check boxes before submitting the form:

$("form").submit(function() {
    $("input:checkbox", this).prop("disabled", false);
});

如果你不希望重新安装所有检查箱,你可以使用更先进的挑选器。

另一种方式是要求张贴所有或某些不平衡的投入:

  1. Step1: give a class name name (eg. mod).
  2. 步骤2:通过提供,使所有这些领域都能够做到如下:

    (单位:残疾)

  3. Step3: Post data

  4. 步骤4:根据以下例子,再次(如有必要)消除这些领域:

    $("input[class=mod]").attr( disabled="disabled" );





相关问题
CSS working only in Firefox

I am trying to create a search text-field like on the Apple website. The HTML looks like this: <div class="frm-search"> <div> <input class="btn" type="image" src="http://www....

image changed but appears the same in browser

I m writing a php script to crop an image. The script overwrites the old image with the new one, but when I reload the page (which is supposed to pickup the new image) I still see the old one. ...

Firefox background image horizontal centering oddity

I am building some basic HTML code for a CMS. One of the page-related options in the CMS is "background image" and "stretch page width / height to background image width / height." so that with large ...

Separator line in ASP.NET

I d like to add a simple separator line in an aspx web form. Does anyone know how? It sounds easy enough, but still I can t manage to find how to do it.. 10x!

热门标签