如何从表单中访问序列数据?

时间:2017-11-14 10:11:08

标签: javascript html json

填充JSON数组的HTML代码:

<table>
    <tr>
        <td> <label> Did you like this presentation?</label> </td>
        <td>
            <select id="Q181" onchange="window.parent.addDataFromElement(this[this.selectedIndex])">
                <option id="R201" value="R201">Yes</option> 
                <option id="R202" value="R202">No</option> 
            </select>
        </td>
    </tr>
    <tr>
        <td> <label>Could you please give us your opinion?</label> </td>
        <td> <input type="text" id="Q183" onchange="window.parent.addData(this.id,this.value)"/> </td>
    </tr>
    <tr>
        <td> <label id="Q184">Are you satisfied?</label> </td>
        <td>
            <input type="checkbox" id="R203" value="R203" onclick="window.parent.addDataFromElement(this)">Yes</input><br>
            <input type="checkbox" id="R204" value="R204" onclick="window.parent.addDataFromElement(this)">No</input>
        </td>
    </tr>
    <tr>
        <td> <label>Give a rating from 1 to 5</label> </td>
        <td> <input type="number" max="5" min="1" id="Q185" onchange="window.parent.addDataFromElement(this)"/> </td>
    </tr>
</table>

获取数据的代码:

<span class='template' data-template='${context.presentations[0].sequences[6].data[0].value}'></span>

错误消息是: error during template : TypeError: context.presentations[0].sequences[6] is undefined

如何访问sequences

0 个答案:

没有答案