0

modx アドオン formz を使用して、フォームに gumbyframework を使用したいと考えています。そのためには、以下の独自のチャンクを作成する必要がありました。必要なすべての要素があり、チャンクが使用されていると「思う」ので、これが正しく機能しない理由がわかりません。ただし、メインのエラー メッセージは表示されます。

このエラー メッセージも表示されますが、formz に関連しているかどうかはわかりません。

[2014-03-03 19:32:47] (ERROR @ /example/index.php) `[[+id]]` is not a valid integer and may not be passed to makeUrl()

フォームTpl

[[!FormIt?
&hooks=`[[+action]][[+hooks:notempty=`,[[+hooks]]`]]`
&tpl=`emailTpl`
&excludeFields=`submit[[+id]]`
&submitVar=`submit[[+id]]`
&formid=`[[+id]]` [[- "Form ID"]]
&store=`1`
&storeTime=`900`
&successMessage=`<p>[[+success_message]]</p>`
&emailTo=`[[+email:default=``]]`
[[+properties]]
[[+validation:notempty=`&validate=`[[+validation]]``]]
[[+validationText:notempty=`[[+validationText]]`]]
]]

[[!+fi.successMessage]]
[[!+fi.validation_error_message]]

<form id="form[[+id]]" class="form [[+identifier]]" action="" method="post">
<fieldset>
    [[+fields]]
</fieldset>

<div class="actions row">
    <div class="form__field__submit columns ten push_two">
        <input type="hidden" name="submit[[+id]]"  value=" [[+action_button:default=`Submit`]]"/>
        <a class="submit" type="submit" name="submit[[+id]]" class="btn primary" href="javascript:document.getElementById('form[[+id]]').submit();">[[+action_button:default=`Submit`]]</a>
    </div>
</div>

フィールドTpl

[[!field? &type=`[[+type]]` &name=`[[+id]]` &label=`[[+label]]` &req=`[[+required]]` [[+type:eq=`checkbox`:then=`&array=`1``]] &options=`[[+values]]` &default_value=`[[+default]]` &tpl=`formz__field--gumby` &outer_tpl=`formz__wrap--gumby`]]

フィールドラップ

<!-- default -->
<div class="[[+outer_class]] row" id="[[+name]]_wrap">
<div class="form__field__label columns two">
<label for="[[+name]]" title="[[+name:replace=`_== `:ucwords]]">[[+label:default=`[[+name:replace=`_== `:ucwords]]`]][[+req:notempty=` *`]]</label>
</div>
<div class="form__field__input columns ten field">
[[+inner_html]]
[[+note:notempty=`<span class="[[+note_class:default=`note`]]"><em>[[+note]]</em></span>`]]
[[+error:notempty=`<span class="[[+error_class]]">[[+error]]</span>`]]
</div>
</div>
<!-- default -->

<!-- select -->
<div class="[[+outer_class]] row form__row--half_margin_bottom" id="[[+name]]_wrap">
<div class="form__field__label columns two">
<label for="[[+name]]" title="[[+name:replace=`_== `:ucwords]]">[[+label:default=`[[+name:replace=`_== `:ucwords]]`]][[+req:notempty=` *`]]</label>
</div>
[[+inner_html]]
[[+note:notempty=`<span class="[[+note_class:default=`note`]]"><em>[[+note]]</em></span>`]]
[[+error:notempty=`<span class="[[+error_class]]">[[+error]]</span>`]]
</div>
</div>
<!-- select -->

<!-- radio -->
<div class="[[+outer_class]] row form__row--half_height" id="[[+name]]_wrap">
<div class="form__field__label columns two">
<label for="[[+name]]" title="[[+name:replace=`_== `:ucwords]]">[[+label:default=`[[+name:replace=`_== `:ucwords]]`]][[+req:notempty=` *`]]</label>
</div>
[[+inner_html]]
[[+note:notempty=`<span class="[[+note_class:default=`note`]]"><em>[[+note]]</em></span>`]]
[[+error:notempty=`<span class="[[+error_class]]">[[+error]]</span>`]]
</div>
</div>
<!-- radio -->

<!-- checkbox -->
<div class="[[+outer_class]] row form__row--half_height" id="[[+name]]_wrap">
<div class="form__field__label columns two">
<label for="[[+name]]" title="[[+name:replace=`_== `:ucwords]]">[[+label:default=`[[+name:replace=`_== `:ucwords]]`]][[+req:notempty=` *`]]</label>
</div>
[[+inner_html]]
[[+note:notempty=`<span class="[[+note_class:default=`note`]]"><em>[[+note]]</em></span>`]]
[[+error:notempty=`<span class="[[+error_class]]">[[+error]]</span>`]]
</div>
</div>
<!-- checkbox -->

フィールドタイプ

<!-- default -->
    <input type="[[+type]]" name="[[+name]]" id="[[+key]]" value="[[+current_value:default=`[[+default]]`]]" class="[[+type]] [[+class]][[+error_class]] text" size="[[+size:default=`40`]]" placeholder="[[+default]]" />
<!-- default -->

<!-- file -->
    <input type="[[+type]]" name="[[+name]][[+array:notempty=`[]`]]" id="[[+key]]" class="[[+type]] [[+class]][[+error_class]]" />
<!-- file -->

<!-- hidden -->
    <input type="[[+type]]" name="[[+name]]" value="[[+current_value:default=`[[+default]]`]]" />
<!-- hidden -->

<!-- textarea -->
    <textarea id="[[+key]]" class="[[+type]] [[+class]][[+error_class]]" name="[[+name]]">[[+current_value:default=`[[+default]]`]]</textarea>
<!-- textarea -->

<!-- checkbox -->
<div class="form__field__input field columns ten [[+error_class]]">
    <input name="[[+name]][[+array:notempty=`[]`]]" type="hidden" value="" />
    [[+options_html]]
<!-- checkbox -->

<!-- radio -->
<div class="form__field__input field columns ten [[+error_class]]">
    <input type="hidden" name="[[+name]]" value="" />
    [[+options_html]]
<!-- radio -->

<!-- select -->
<div class="form__field__input field columns ten [[+class]][[+error_class]]">
    <input type="hidden" name="[[+name]][[+array:notempty=`[]`]]" value="" />
    <div class="picker">
        <select name="[[+name]][[+array:notempty=`[]`]]" id="[[+key]]" class="[[+class]] select"[[+multiple:notempty=` multiple="multiple"`]][[+title:notempty=` title="[[+title]]"`]]>
            [[+header:notempty=`<option value="[[+default]]">[[+header]]</option>`]]
            [[+options_html]]
        </select>
    </div>
<!-- select -->

<!-- static -->
<span class="static_field[[+error_class]]">[[!+[[+name]]]]</span>
<!-- static -->

<!-- submit -->
<input id="[[+key]]" class="button [[+type]] [[+class]]" name="[[+name]]" type="[[+type]]" value="[[+message:default=`Submit`]]" />
<input id="[[+name]]-clear" class="button [[+type]] [[+class]]" type="reset" value="[[+clear_message:default=`Clear Form`]]" />
<!-- submit -->

<!-- option --><option value="[[+value]]">[[+label]]</option><!-- option -->

<!-- bool -->
<label for="[[+key]]" class="[[+type]]" id="label[[+key]]">
    <input name="[[+name]][[+array:notempty=`[]`]]" id="[[+key]]" value="[[+value]]" type="[[+type]]" />
    <span class="[[+type]]_icon"></span>
    [[+label]]
</label>
<!-- bool -->
4

2 に答える 2

0

「id」[name="id"]というフィールドを明示的に送信していないか、makeUrl関数がこれを処理しようとしていると思います:&formid = [[+id]][[- "フォームID"]]、実際には整数が必要です。

また、formidは実際にはformitのパラメーターですか? [そうであれば、formID ではないですか?]

于 2014-03-05T00:33:32.117 に答える