473,651 Members | 2,538 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to pass multiple values in table to another form

6 New Member
Dev't Tool: Visual C# 2003 and Javascript
System Type: Web Application

One requirement of the system is to dynamically create a table on client-side (Javascripting using createElement method.) The table has textboxes inside each cell.

a few sample code:

Expand|Select|Wrap|Line Numbers
  1. for (i = 0; i < 4; i ++) // four columns
  2. {
  3.   textBoxes = document.createElement("INPUT");
  4.   textBoxes.type = "text";
  5.   textBoxes.id = "txt1";
  6.   textBoxes.name = "txtA";
  7.   cell.appendChild(textBoxes);
  8. }

These are my options to get the values:
1. Through querystring -> but not possible because there are many values to be passed.
(sample: WebForm2.aspx?v alue1=&value2)

2. Also tried getting it by Request.Form["txtA"]
I can get the values but it is comma delimited. I cannot get exact data when my input has "," in it.
(sample: Input1 = "a,b"; Input2= "c"; Request.Form["a,b,c"])
if to be split, 3 values will be returned instead of 2.

Maybe there's another option that you can suggest so I can retrieve those multiple data.

One more thing, I would like those data to be on one-time retrieval because in the INSERT process, I plan to include them on a loop inside a TRANSACTION statement so if one record encountered an error, all will ROLLBACK.
Nov 7 '08 #1
3 2974
acoder
16,027 Recognized Expert Moderator MVP
Firstly, IDs should be unique, so in the for loop use the index to give the unique ID strings. To avoid the problem of commas, you could rename the text boxes to make them unique.
Nov 9 '08 #2
cubekid
6 New Member
Thanks for the reply. I solved the problem by using my 2nd option which I stated before (Request.Form["txtA"]).

I just created a function that replaces "," with "%2c" so that if a user tends to input a value with ",", the parser will not treat it as a delimiter, thus splitting the returned value accurately.
Jan 27 '09 #3
acoder
16,027 Recognized Expert Moderator MVP
Thanks for posting back with your solution.
Jan 27 '09 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

1
8734
by: PT | last post by:
I got a problem. And thats..... First of all, I got these three tables. ------------------- ------------------ ---------------------- tblPerson tblPersonSoftware tblSoftware ------------------- ------------------ ---------------------- PID PName PID* SID* SID SWName --- ----- --- --- --- ------ 1 Thomas 1 1 ...
1
2024
by: james00_c | last post by:
Greetings- I need to pass multiple email addresses to a "sendto" hidden field in a form. I need to do that because "CC" and "BCC" are not an option. One address webmaster@xyz.com would be hardcoded and another say formuser@xyz would be a user input. A sample of my form looks like: <table> <tr> <td width="100%"> <form name="fname" method="POST"
3
3573
by: Steven Stewart | last post by:
Hi there, I have posted about this before, but yet to arrive at a solution. I am going to try to explain this better. I have an Employees table and a Datarecords table (one-to-many relationship). I have fields called InventoryOut and BalanceEnd that are calculated on the fly for reports and when displayed on forms (they are not part of any table). I have another field called "BalCarFor" (Balance Carried Forward) that is part of the...
4
4797
by: tom | last post by:
Hi Experts, I want to pass the selectedDate value from my calender form to another web form or a web user control. Could you please show me how to do this? Thanks in advance.
8
6574
by: darrel | last post by:
I'm still trying to fully understand how best to pass variables between pages/usercontrols/each other. On a current site I've done, I've had one userControl do the logic and set the variable, and then I had other usercontrols simply read this by traversing the class structure: siteClass.userControlClass.specficVariable. That worked fine. The new site I'm working on is a bit different, as I'm using multiple
2
2506
by: c676228 | last post by:
Hi, This is my first time to post asp.net question on this forum. I have a question for "How to pass the first form value to the next form" I have enrollinfo.aspx form which look like as follow: <form id="Form1" method="post" runat="server"> <Subway:Address id="address" runat="server" Caption="Home Address"></Subway:Address> <p></p> <SUBWAY:PEOPLEINFO id="Peopleinfo" runat="server" Caption="Employee Information"></SUBWAY:PEOPLEINFO>
6
10479
by: ApexData | last post by:
I have 2 tables: Table1 and Table2. Neither one has a primary key because each table will only have 1-record. My form is a SingleForm unbound with tabs (my desire here). Using this form, in the Record Source I originally had the statement TABLE1, and all worked fine. Now I want to open the second table as well, and this is where my problem is.
17
7068
by: Rabbit | last post by:
Hi, On my 1st page, i have a function which gets a new ID value and need to transfer to another immediately. which I want to get in 2nd page using Request.form("txtID"), but doesn't work, the returned value is "" Anybody know how to set this value on 1st page properly, in order to let 2nd page catch it? I don't want to use querystring to pass this value!
1
9352
by: colleen1980 | last post by:
Hi: Can any one please tell me that how to i pass the two textbox values in the new page. If i use the form action in the popup window page then the new page is open in the same popup window as i need to open the new page in the main page window with passing the two textbox parameters into the new page. Program opens the new page but dont know how to pass the two textboxes values into the new page name deceasedToday.asp Needs help in...
0
8347
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
8792
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
8571
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7294
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...
0
4143
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...
0
4280
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2696
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
1
1905
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1585
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.