简体   繁体   中英

how can I display my array data into textboxes?

Here's the scenario, I have here my array from my sqlite db then I already converted it into array, now I need to display every element into textbox. Can someone help me, please? Thank you! Btw it's flask/python.

Javascript

 $(function(){
            window.setInterval(function(){
                liveClock();
                loadNewDecimal();
            }, 1000);

            function loadNewDecimal(){
                $.ajax({
                    url:"/update_decimal",
                    type: "GET",
                    dataType: "json",
                    success: function(data){
                        arr = data.row1 + ''

                        conv_arr = arr.split("-")
                        //console.log(conv_arr)
                    }
                    
                });
            };

HTML

   </div>
         <form class="form-inline text-center justify-content-center">
                <form class="form-inline text-center justify-content-center">
                {% for row1 in rows %} <input type="text" class="form-control col-md-1  mb-2 mr-sm-2" id="Cell1" placeholder="Cell1" value="{{row1["cell1"]}}" readonly>  {% endfor %} 
                </form>
        </form>
      </div>

只需将其显示为 JSON

JSON.stringfig(arr)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM