I have following code in Node.js:
<% var count = JSON.parse(data).Count;
var countInAPage = 10;
for(i = 0; i < count[0].count / countInAPage; i++) { %>
<form method="get" id="button-form" hidden>
<input type="text" name="from" value=
<% i * countInAPage; %>
>
<input type="text" name="to" value=
<% (i + 1 ) * countInAPage; %>
>
</form>
<button type="submit" form="button-form" value="Submit"><%- i + 1; %></button>
<% } %>
In above code count is coming from back end. Now i want to loop the HTML content, for doing so i need to assign the value for those above input type dynamically (as i tried above <% i * countInAPage; %>); but i am unable to do so.
So what would be the appropriate method or solution for such scenario, where i need to call get method on clicking the submit button?
Aucun commentaire:
Enregistrer un commentaire