0

サーバーからのAjax応答に基づいて、htmlフォーム全体を動的に生成する必要があります。それに応じて、入力タイプ、入力ラベル、検証(ある場合)などの情報があります。

フォームには常に最大で10個のフィールドがあります。

フォームを生成するためのjQuery/javascriptツール/プラグインはありますか?

ありがとう。

4

1 に答える 1

0

形成

彼らの例から:

    value = {"key":"value"} "key" will be the value attribute and "value" will be the shown value of the element. If the array is constructed like {"value",value","value"} (without keys) then the value attribute of the input will be an auto-incremented number starting from 0.
options = {} See options table below.

$.fn.formation(options); [Create a form]
$.formation.addInput(options); [Append an input]
$.formation.addSelect(values,options); [Append a select]
$.formation.addTextarea(options); [Append a textarea]
$.formation.addCheckboxes(values,options); [Append an unordered list of checkboxes]
$.formation.addRadios(values,options); [Append an unordered list of radio buttons]
$.formation.addCaptcha(options); [Adds a captcha question to your form]
$.formation.addButton(options); [Append a button]
$.formation.setErrorMessages(options); [Set custom error messages for validation]

ただし、これはすべてJqueryで簡単に実行できることであり、優れた学習体験であるため、自分で試してみることをお勧めします。

于 2011-10-12T06:52:47.823 に答える