首页 > 解决方案 > Excel/CSV connection with site

问题描述

I am making an e-shop that has to be connected to an excel or CSV file.

More specifically I need to connect excel rows to input boxes (prices,bottles,etc). All those inputs will be connected to an input slider(type=range)just like the JS below.

I have researched this matter very much and someone told me I need to use XML. I can't use pure JS/Python because it needs to be updated constantly and I am completely clueless as to how I should proceed. Let me know if anything is not clear.

Thanks in advance.

        <script>
        var city = document.getElementById('city')
        var cityrepeat = document.getElementById('cityrepeat')
        var state = document.getElementById('state')
        var staterepeat = document.getElementById('staterepeat')

        function setCity() {
          cityrepeat.value = city.value
        }

        function setd() {
          city.value = cityrepeat.value
        }

        function setState() {
          staterepeat.value = state.value
        }
        </script>

        City    
        <input id="city" type="text" onChange="setCity()" size=5/></br>
        State
        <input id="state" type="text" onChange="setState()" size=5/></br>
        City repeat
        <input id="cityrepeat" type="range" min="1" max="100" onChange="setd()"/>
        <br>
        State repeat
        <input id="staterepeat" type="range"/>

标签: javascriptpythonhtmlxml

解决方案


您可以将表单数据发送到后端,然后从那里将其写入 xls/csv 文件。由于您使用的是python,您可以在此处查找包


推荐阅读