473,785 Members | 2,767 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Create Dynamic Input Names or Input Fields in Asp

I have a little code to add multiple items to a shopping cart based
page. This code works perfect, but it adds all of the info to the
same input fields every time it loops. I need it to change the input
names each time it loops. Here is the code.
<% FOR x = 0 TO UBOUND( localCart, 2 )
IF localCart( CARTPID, x ) <> "" THEN
orderTotal = orderTotal + ( localCart( CARTPPRICE, x ) * localCart
( CARTPQUANTITY, x ) )

DIM chId,chProduct, chPrice,chQuant ity
chId=(localCart ( CARTPID, x) )
chProduct=Serve r.HTMLEncode( localCart( CARTPNAME, x ) )
chPrice=formatC urrency( localCart( CARTPPRICE, x ) )
chQuantity=loca lCart( CARTPQUANTITY, x )%>

<input name="Partnumbe r1" type="text" value="<%="" & chId & vbcrlf &
"" %>" size="40">
<input name="Partnumbe r2" type="text" value="<%="" & chProduct & ""
%>" size="40">
<input name="Partnumbe r3" type="text" value="<%="" & chPrice & "" %>"
size="40">
<input name="Partnumbe r4" type="text" value="<%="" & chQuantity & ""
%>" size="40">

<%
END IF
Next
%>

This is what I am getting with two items in the cart. Duplicate
PARTNUMBERS.

<input name="Partnumbe r1" type="text" value="07908-00036 " size="40">
<input name="Partnumbe r2" type="text" value="Right Mounting Bracket -
for Mounting Tape Drive to Chassis" size="40">
<input name="Partnumbe r3" type="text" value="$11.00" size="40">
<input name="Partnumbe r4" type="text" value="3" size="40">
<input name="Partnumbe r1" type="text" value="27303-69001 " size="40">
<input name="Partnumbe r2" type="text" value="ThinLAN (10Base-2) Board
- for NOVELL NetWare" size="40">
<input name="Partnumbe r3" type="text" value="$216.00" size="40">
<input name="Partnumbe r4" type="text" value="3" size="40">
I need to get different PARTNUMBERS such as this.

<input name="Partnumbe r1" type="text" value="07908-00036 " size="40">
<input name="Partnumbe r2" type="text" value="Right Mounting Bracket -
for Mounting Tape Drive to Chassis" size="40">
<input name="Partnumbe r3" type="text" value="$11.00" size="40">
<input name="Partnumbe r4" type="text" value="3" size="40">
<input name="Partnumbe r5" type="text" value="27303-69001 " size="40">
<input name="Partnumbe r5" type="text" value="ThinLAN (10Base-2) Board
- for NOVELL NetWare" size="40">
<input name="Partnumbe r7" type="text" value="$216.00" size="40">
<input name="Partnumbe r8" type="text" value="3" size="40">

Thanks for any help in advance.
Jul 19 '05 #1
0 2767

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
4082
by: Nick | last post by:
Loop to create an array from a dynamic form. I'm having trouble with an application, and I'll try to explain it as clearly as possible: 1. I have a form with two fields, say Apples and Oranges. The user selects from a drop down menu, between 1-10 of each and clicks submit. The resulting page will display a NEW form, with rows and a list of fields for the amount of each items selected.
9
3432
by: MAFranklin | last post by:
I've created a form with several input fields. At the beginning of my form I use a set of radio buttons to determine how to validate the form as well as determine what fields are required. Because the form is so lengthy, I would like to aid users by including visual clues as to what fields require information by changing the background color of that field to red. I understand how to accomplish this field by field however, I am looking for...
6
7404
by: 35th Ave Media | last post by:
Hello, I have about 60+ pages that I need to insert a MAILTO: tag so people can email the page using their email client. The body of the message is going to be the URL of that page. Using ASP, how can I insert the page URL in the email body without having to manually enter each URL for each MAILTO: tag? Is there a variable that can be used inside the MAILTO: tag that automatically inserts the current page's URL into the body of the...
23
7418
by: sandy | last post by:
I need (okay, I want) to make a dynamic array of my class 'Directory', within my class Directory (Can you already smell disaster?) Each Directory can have subdirectories so I thought to put these in an array. The application compiles but aborts without giving me any useful information. What I suspect is happening is infinite recursion. Each Directory object creates an array of Subdirectories each of which has an array of...
3
18718
by: creative1 | last post by:
Here is how you create a complex data report that involves parent and child commands and you can update information at runtime. Its pretty straight forward to work with simple queries; however, working with complex reports is tricky Assumption: Reader of this article have basic knowledge of creating data reports. Creating a Parent-Child Command and create a DataReport Suppose we have a database called company with two tables ...
1
4660
by: MaryamSh | last post by:
Hi, I am creating a Dynamic Search in my application. I create a user control and in Page_load event I create a dynamic dropdownlist and 2 dynamic button (Add,Remove) By pressing Add button ,another row will be created with the same control (I mean another dropdown and 2 button) and so on. and by pressing Remove button the selecetd row will be removed. I used viewstate to keep my value for postback, I want by changing selectedvalue of...
0
3501
by: MaryamSh | last post by:
Create Dynamic Dropdownlist Controls and related event -------------------------------------------------------------------------------- Hi, I am creating a Dynamic Search in my application. I create a user control and in Page_load event I create a dynamic dropdownlist and 2 dynamic button (Add,Remove) By pressing Add button ,another row will be created with the same control (I mean another dropdown and 2 button) and so on. and by...
15
5277
by: lxyone | last post by:
Using a flat file containing table names, fields, values whats the best way of creating html pages? I want control over the html pages ie 1. layout 2. what data to show 3. what controls to show - text boxes, input boxes, buttons, hyperlinks ie the usual. The data is not obtained directly from a database.
0
9645
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9480
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10329
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10152
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8974
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7500
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5381
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4053
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3650
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.