473,715 Members | 6,112 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

display multiple input boxes based on results

Say a customer inserts into a sql database field (NUMINSERTS) the number
6.

On the following page, I want to build a table that displays 6 input
boxes, since the customer said they wanted 6 text boxes.

I will then insert the data from the 6 text boxes back into another sql
database table.

For example:
Page 1: Ask client how many items they want to insert. Client types in
6.
Page 2: Table is displayed with input boxes for title of item 1 and
price of item 1. Then title for item2 and price for item 2, and on and
on until 6 are diaplyed.

How do I get the correct number of text boxes to be displayed? AND then,
how do I insert them into another table (ITEMINFO)
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Jul 19 '05 #1
2 1974
Hi Joey,

Try something like this.

<%
''user submitted number already, i.e. 6
iNumberOfTextBo xes = Request.Form("t xtNumberOfTextb oxesDesired")
''code to make sure there was no
''nonsense input, like a letter, or empty, etc.
%>

<form method="post" action="process .asp">
<% For i = 1 To iNumberOfTextBo xes %>

<input name="txtTitle< %=i%>" type="text">
<input name="txtPrice< %=i%>" type="text">
<% Next %>

<input type="hidden" name="count" value="<%=iNumb erOfTextBoxes%> ">
<input type="submit">
</form>
process.asp:

<%
iCount = Request.Form("c ount")
'''open ado connection, oADO
For i = 1 To iCount
sTitle = Request.Form("t xtTitle" & i)
sPrice = Request.Form("t xtPrice" & i)

'''validate the input here

sSQL = "INSERT INTO someTable (Title,Price) VALUES ('" & sTitle & "'," &
sPrice & ")"
oADO.Execute sSQL,,129
Next
'''close and kill ADO connection
%>

That would be a basic layout of what would happen. You'd generate the form
on the fly with input boxes named:

txtTitle1,txtPr ice1
txtTitle2,txtPr ice2
txtTitle3,txtPr ice3
txtTitle4,txtPr ice4
....

Then you'd write the number to a hidden input.

Then when the form is submitted, you'd take the value from the hidden input
and use that to rebuild the input element names.

You'd want to make sure you add validation code all over.

Ray at work


"Joey" <no****@infosmi ths.net> wrote in message
news:uA******** ******@TK2MSFTN GP09.phx.gbl...
Say a customer inserts into a sql database field (NUMINSERTS) the number
6.

On the following page, I want to build a table that displays 6 input
boxes, since the customer said they wanted 6 text boxes.

I will then insert the data from the 6 text boxes back into another sql
database table.

For example:
Page 1: Ask client how many items they want to insert. Client types in
6.
Page 2: Table is displayed with input boxes for title of item 1 and
price of item 1. Then title for item2 and price for item 2, and on and
on until 6 are diaplyed.

How do I get the correct number of text boxes to be displayed? AND then,
how do I insert them into another table (ITEMINFO)
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Jul 19 '05 #2
Ray, thanks for your help. That's what I needed!

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Jul 19 '05 #3

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

Similar topics

4
3819
by: Dave Parrin-Bull | last post by:
Hi all, I have been asked (nay told!) to do a quiz for a webpage at work, now I can do the basic things like getting the radio boxes up there and assign values to them but here is what they want: 5 options (done that) You can only select 2 of the 5 options (dont know how to do that)
19
6926
by: dmiller23462 | last post by:
Hi guys....I have absolutely NO IDEA what I'm doing with Javascript but my end result is I need two text boxes to stay hidden until a particular option is selected....I've cobbled together the JavaScript in this code from a couple different sites but I'm not 100% sure what each line is doing...This is the ASP code that I'm using for the page....Take a look at the JavaScript code and please let me know what each line is doing....I have been...
6
4297
by: Ben Hallert | last post by:
Hi guys, I'm trying to figure out what bone headed mistake I made on something I put together. I've got a form (named 'context') that has a variable number of select-multiple inputs on it. Based on the number of variables passed through a GET string, I want to multiply the total number of selected items for each together to see how many possible combinations the selected items are generating. The following snippet of code...
3
2201
by: Scott | last post by:
Relative newbie here, I'm looking to display the value of radio buttons and check boxes on the page before submission. So far I can do most of it. When "Hat" is checked there are to be no color options available. Click on shirt or pants, you have three options, (actually four if you chose "None"). Shirts and pants can have multiple colors. OK, here is the issue, if you choose a color then change your mind and then un-check the box, it...
11
4530
by: dskillingstad | last post by:
I've been struggling with this problem for some time and have tried multiple solutions with no luck. Let me start with, I'm a novice at Access and I'm not looking for someones help to design my database,just help in getting me pointed in the right direction. I have a database with 8 tables, which from what I have read, cannot be linked on a single form, and be updatable. I have created a query which includes all 8 tables, and then...
2
4020
by: Damon Cherne | last post by:
Here is my issue. I have created a form called “Search” that has several unbound combo boxes, one for each of the attribute that match a column in the Table . Each combo box has input from a separate table that limits what the uses can select. IE. The Genre table feeds a list of options for the Genre combo box. My goal is to have the user select the attributes they want to use as search criteria and then feed those selections from the...
2
7052
by: assgar | last post by:
Hi Developemnt on win2003 server. Final server will be linux Apache,Mysql and PHP is being used. I use 2 scripts(form and process). The form displays multiple dynamic rows with chechboxs, input box for units of service, description of the service and each row has its own dropdown list of unit fees that apply. Each dynamically created row will return 3 values fee1_choice, fee1_unit and fee1_money. Note The above informaton is...
5
8116
by: Brett | last post by:
Hello, Is it possible to have just one criteria and have it apply to a group of queries? I am trying to create a report with the separate results of 4 queries based on a prompt for the user to input (only once) a date. Is this something that I program into the report? Also, this is related but may require a separate posting, but can I do
1
6797
by: woodey2002 | last post by:
Hi Everyone and many thanks for your time.. I am trying to begin access and a bit of VBA i am enjoying it but I have a annoying problem I just can’t get any where on. My databse mostly includes bits of code for different examples. I have one last thing to finish. I am trying to create a search form that will allow users to select criteria from multiple sources eg ,multi select list boxes , combo boxes. I have a subform showing all the...
0
8823
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
8718
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
9198
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...
1
9104
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7973
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
6646
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
5967
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
3175
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
2541
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.