473,386 Members | 1,720 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Sending several input tags with the same name

Hi guys, i have a question. On old asp, if i did this:

<input type="text" name="myname" value="1">
<input type="text" name="myname" value="2">

asp would make request("myname")="1, 2"

on asp.net, request["myname"] is "1,2" (without the space)

The problem with this is that i am trying to pass multiple currency
values , which have commas inside them. On old asp this wasn't a
problem since i splitted the string with ", " but on asp.net i need to
do "," which of course wouldn't work properly.

Is there a way i can make asp.net use a different separator? Currently
i am employing a hack, replacing the commas with asterisks and then
change then back once read...

Sep 4 '07 #1
3 1131
I don't know what the advantage of using multiple form elements all with the
same names might be, other than to force you to employ hacks to get around it.
However, the hack you describe seems to work, so "if it ain't broke, don't
fix it".
Peter
Recursion: see Recursion
site: http://www.eggheadcafe.com
unBlog: http://petesbloggerama.blogspot.com
BlogMetaFinder: http://www.blogmetafinder.com

"Seguros Catatumbo" wrote:
Hi guys, i have a question. On old asp, if i did this:

<input type="text" name="myname" value="1">
<input type="text" name="myname" value="2">

asp would make request("myname")="1, 2"

on asp.net, request["myname"] is "1,2" (without the space)

The problem with this is that i am trying to pass multiple currency
values , which have commas inside them. On old asp this wasn't a
problem since i splitted the string with ", " but on asp.net i need to
do "," which of course wouldn't work properly.

Is there a way i can make asp.net use a different separator? Currently
i am employing a hack, replacing the commas with asterisks and then
change then back once read...

Sep 5 '07 #2
I don't know what the advantage of using multiple form elements all with the
same names might be, other than to force you to employ hacks to get around it.
However, the hack you describe seems to work, so "if it ain't broke, don't
fix it".
The advantage is less code.
You can simply split the request variable to an array of strings and
work with them in a simple iteration. If i would use different names
for the variables, it would require more code. Storing objects in the
session or in the viewstate would not be as efficient. Old asp's way
of handling same name input was better IMO

Sep 5 '07 #3
"Seguros Catatumbo" <se**************@gmail.comwrote in message
news:11**********************@22g2000hsm.googlegro ups.com...
>I don't know what the advantage of using multiple form elements all with
the
same names might be, other than to force you to employ hacks to get
around it.
However, the hack you describe seems to work, so "if it ain't broke,
don't
fix it".

The advantage is less code.
That's not necessarily better...
You can simply split the request variable to an array of strings and
work with them in a simple iteration. If i would use different names
for the variables, it would require more code.
But less hacking...
Old ASP's way of handling same name input was better IMO
<input type="text" name="myname" value="1">
<input type="text" name="myname" value="2">
Hmm - if you add a new text control between those two, you'd have to give it
a value of 3 - after a while, that would surely get really messy, no...?
--
Mark Rae
ASP.NET MVP
http://www.markrae.net

Sep 5 '07 #4

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

Similar topics

4
by: pablo | last post by:
Dear News Groupers, I'am trying to send a php array with a hidden input field from a form to another script. The array is NOT made directly by way of <input name="arrayname" />. The array is...
0
by: Lea | last post by:
Hi, I 've got a problem concerning the text alignment of my three input tags. In IE6, the "login" and "ok" words are completely aligned on the bottom border. Yet my padding is : 0px 0px 0px 1px;...
12
by: Randell D. | last post by:
Folks, I have a form called "ourTestForm". Its a test form - nothing special - it contains five input tags - they are named one, two, three, four and five. The input tags are of type...
2
by: Chris | last post by:
I am new to these forums and hope I am in the right place! I am working on an ASP (3.0) page that displays hotel data from a recordset in a table. In the last column of each row, I want to...
5
by: Chris | last post by:
I have a meetings section I'm developing on our intranet. Using PHP/MySQL. Meeting info and Meeting docs reside on 2 related tables in the db. Users may want to upload anywhere from 1 to 10 or...
0
by: Andrea | last post by:
Hi I've having a very strange problem using the SendInput API to send text to other applications. I've written the code and it seems to work well. I discovered a strange problem: when I try to...
6
by: dougmcdonald | last post by:
Hi All, I have a question regarding the use of the input tag in forms when using xHTML 1.1 strict. Basically I'm getting errors suggesting the input tag is not allowed inside the form e.g:...
3
by: pradeepdeepu | last post by:
hi, sorry for replying like this.Below is my html code.I need to send all field values to email id.I must do it in PHP,but i don't no php. Please help me by sending code for this html page.It is...
7
by: bleachie | last post by:
Hey, I just need some help, my form seems to not send me all of the 'guestNames' and 'guestEmails' forms. i use this function to add more guestnames and guestemail fields based on the number of...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
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...
0
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,...
0
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...

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.