Ask a Question related to ASP, Design and Development.
-
gotcha #1
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,chQuantity
chId=(localCart( CARTPID, x) )
chProduct=Server.HTMLEncode( localCart( CARTPNAME, x ) )
chPrice=formatCurrency( localCart( CARTPPRICE, x ) )
chQuantity=localCart( CARTPQUANTITY, x )%>
<input name="Partnumber1" type="text" value="<%="" & chId & vbcrlf &
"" %>" size="40">
<input name="Partnumber2" type="text" value="<%="" & chProduct & ""
%>" size="40">
<input name="Partnumber3" type="text" value="<%="" & chPrice & "" %>"
size="40">
<input name="Partnumber4" 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="Partnumber1" type="text" value="07908-00036 " size="40">
<input name="Partnumber2" type="text" value="Right Mounting Bracket -
for Mounting Tape Drive to Chassis" size="40">
<input name="Partnumber3" type="text" value="$11.00" size="40">
<input name="Partnumber4" type="text" value="3" size="40">
<input name="Partnumber1" type="text" value="27303-69001 " size="40">
<input name="Partnumber2" type="text" value="ThinLAN (10Base-2) Board
- for NOVELL NetWare" size="40">
<input name="Partnumber3" type="text" value="$216.00" size="40">
<input name="Partnumber4" type="text" value="3" size="40">
I need to get different PARTNUMBERS such as this.
<input name="Partnumber1" type="text" value="07908-00036 " size="40">
<input name="Partnumber2" type="text" value="Right Mounting Bracket -
for Mounting Tape Drive to Chassis" size="40">
<input name="Partnumber3" type="text" value="$11.00" size="40">
<input name="Partnumber4" type="text" value="3" size="40">
<input name="Partnumber5" type="text" value="27303-69001 " size="40">
<input name="Partnumber5" type="text" value="ThinLAN (10Base-2) Board
- for NOVELL NetWare" size="40">
<input name="Partnumber7" type="text" value="$216.00" size="40">
<input name="Partnumber8" type="text" value="3" size="40">
Thanks for any help in advance.
gotcha Guest
-
Create Dynamic PDF with input fields
Hi, I have conclude the way to built a dynamic PDF document with CFDOCUMENT and CFDOCUMENTITEM on ColdFusion 7. But, I need to push further the... -
Array question for input fields
:confused; Can you have an array for a input name field. For example: <input type="hidden" name="passID" value="#id#"> <input type="text"... -
$_POST behavior from input=submit vs input-type=button
Hello all, I have been trying to solve an annoying behavior with PHP (I think). Maybe some of you have encountered the same and have some ideas.... -
Perl Newbie question: How would you take keyboard input and run a shell scrip with that input?
I don't think you could be vaguer :) Very basic #!/usr/bin/perl # update.pl multiple options command line my @packages = @ARGV foreach... -
Formats, fields, input masks, et al
Okay, I understand what you are saying, and the customer wants it, so the customer gets it. And you're right, even if you default the area code...



Reply With Quote

