如何使用cs cart中的按钮提交表单

时间:2018-04-23 07:51:15

标签: cs-cart

<div class="ty-company-fields">
    <div class="apply_for_vendor_account">
        <h1 class="tygh-top-panel ty-dropdown-box__title ty-mainbox-simple-title ty-mainbox-simple-container clearfix ty-homepage-vendors">Calculator</h1>
        <form action="" method="post" name="calculator" id="calculator">
            <div class="ty-control-group">
                <label for="contact_form" class="ty-control-group__title cm-required ty-input-text cm-focus" >Please Enter First Number</label>
                <input type="text" name="cal[value1]" id="contact_form" size="32" value="{$cal.value1}" class="ty-input-text cm-focus ty-control-group_title cm-required" />
            </div>    

            <div class="ty-control-group">
                <label for="contact_form_number" class="ty-control-group__title cm-required">Please Enter Second Number</label>
                <input type="text" name="cal[value2]" id="contact_form_number" class="ty-input-text cm-focus ty-control-group_title cm-required" size="32" value="{$cal.value2}"  />
            </div> 
            {if $result } 
            <p>The Result is: {$result}</p>
            {/if}
            <div class="buttons-container">
             {include file="buttons/button.tpl" but_text=__("submit") but_name="dispatch[calculator2.add]" but_id="contact" but_meta="ty-btn__primary" value = "+" data-ca-target-form="calculator" data-ca-dispatch="dispatch[calculator.calculator]"}


             {include file="buttons/button.tpl" but_text=__("submit") but_name="dispatch[calculator.add]" but_id="contact" but_meta="ty-btn__primary" value = "+"}
             {include file="buttons/button.tpl" but_text=__("submit") but_name="dispatch[calculator.add]" but_id="contact" but_meta="ty-btn__primary" value = "+"}
             {include file="buttons/button.tpl" but_text=__("submit") but_name="dispatch[calculator.add]" but_id="contact" but_meta="ty-btn__primary" value = "+"}

            </div>
        </form>
    </div>

</div>

1 个答案:

答案 0 :(得分:0)

你可以使用普通表格和普通提交按钮,普通方式也可以在cs购物车中正常使用。

在这种情况下,当您按下按钮时,整个值将发布到控制器 calculator.add 并执行操作。