簡體   English   中英

在單選按鈕自定義版本中,表單在提交時返回 id。 如何獲取表單中的值而不是 id?

[英]In Radio button custom version, the form returns the id when it is submitted. How to get the Value in the form instead of id?

下面是我在表單中的單選按鈕代碼

<div data---="radiobutton__form.sex__datasource:list;required:true;label:Gender">
    <script type="text/html">
        <div class="ui-radiobutton-custom">
            <div>{{ name }}</div>
        </div>
    </script>
</div>
<script type="text/javascript">
    var list = [{ name: 'Male', id: 1 }, { name: 'Female', id: 2 }, { name: 'Other', id: 3 }]
</script>

這很簡單,只需設置value:name_of_property_to_output ,例如:

<div data---="radiobutton__YOUR_PATH__datasource:YOUR_DATASOURCE;value:YOUR_OUTPUT_PROPERTY">Choose somehthing</div>

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM