Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3391774
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T03:50:30+00:00 2026-05-18T03:50:30+00:00

I have a page that contains a form, where part of it is dynamically

  • 0

I have a page that contains a form, where part of it is dynamically generated based off of what SKU’s are on an order.

<% for each i in ViewData.Model %>
                    <script type="text/javascript">
                        $(function () {
                            $('#return_<%=i.SKUN%>').change(function () {
                                if ($('#return_<%=i.SKUN%>').val() > $('#qty_<%=i.SKUN%>').val()) {
                                    $('#Discrepancy').val("Yes");
                                } else {
                                    $('#Discrepancy').val("");
                                }
                            });
                        });
                    </script>
                    <tr>
                        <td style="text-align: left"><%= i.SKUN%></td>
                        <td style="text-align: left; width: 360px"><%= i.DESCR%></td>
                        <td style="text-align: left">&pound;<%= i.PRIC%></td>
                        <td style="text-align: left"><%= i.QUAN%></td>
                        <td style="text-align: left">&pound;<%= i.EXTP%></td>
                        <td style="text-align: left"><input type="hidden" name="qty_<%=i.SKUN%>" id="qty_<%=i.SKUN%>" value="<%= i.QUAN%>"/><input type="text" name="return_<%=i.SKUN%>" id="return_<%=i.SKUN%>" style="width:50px;" class="required"/>
                            <%  If i.FLAG3 = "T" Then
                                   %> <img src="../../Content/images/icons/error.png" alt="This SKU is subject to a <%=Html.ViewData("RestockFee") %>% restocking fee" title="This SKU is subject to a <%=Html.ViewData("RestockFee") %>% restocking fee"/><%
                                End If%>
                        </td>
                    </tr>
                    <% Next%>

It’s by no means perfect, but it gets the job done at the moment.

The part I’m struggling with is as return_<%=i.SKUN%> is a series of dynamically generated text boxes that change for each order, though they remain with the naming convention of return_<%=i.SKUN%>, how do I get the values for them in my controller that handles the form post?

EDIT: It’s also important to note that none of these fields are required fields and that the number of text boxes varies per order.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-18T03:50:31+00:00Added an answer on May 18, 2026 at 3:50 am

    Can’t you change the naming convention to:

    <input 
        type="text"
        name="skuns[<%= index %>]"
        id="return_<%= i.SKUN %>"
        style="width:50px;"
        class="required"
        value="<%= i.SKUN %>"
    />
    

    where index would be an incrementing variable from 0 to n. This way your controller action could look like this:

    Public Function Result(skuns As String()) As ActionResult
    

    And leave the default model binder do the job.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a page on a website that contains a secure form inside an
I have a page that contains several forms, by submitting each one of them,
I have a ASP.NET web page that contains many textboxes. Each textbox has a
We have a long page that contains a bunch of different form elements. One
I have a big form that is split over 3 pages (each page is
I have a pod on my page that contains a form. I have used
I have master page that contains the following asp.net form tag <form id=CommerceMasterForm runat=server>
I have a page that contains 3 forms, each one with a Zend_Form_Element_Hash for
I have a page that contains a dynamically loaded <iframe> . This iframe contains
i have a page that contains several submit buttons however i only want one

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.