473,664 Members | 2,773 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

putting '/' in field name

Hi everyone,
I have a form with '/' in some of the field names, when I pass through to
the next page the field name comes back as though it's been htmlencoded, so
getting the value out of the field I need to convert this back to '/' with
the replace (same problem if I have a ',' in the name)

Is there an easy way to htmldecode or something what it converted to the
encoded versions? (I have written a short function to basically do all my
replaces for me, but I am guessing this isn't the ideal solution)

Many thanks

Stu

Jul 19 '05 #1
4 1933
Not being argumentative but why would you ever want to have a form field
name with a '/' in it - it's such a patently horrible thing to have to deal
with.
My suggestion: change the field names.

Chris.

"Stuart Palmer" <tr**********@y oucant.com> wrote in message
news:bn******** **@sp15at20.hur sley.ibm.com...
Hi everyone,
I have a form with '/' in some of the field names, when I pass through to
the next page the field name comes back as though it's been htmlencoded, so
getting the value out of the field I need to convert this back to '/' with
the replace (same problem if I have a ',' in the name)

Is there an easy way to htmldecode or something what it converted to the
encoded versions? (I have written a short function to basically do all my
replaces for me, but I am guessing this isn't the ideal solution)

Many thanks

Stu


Jul 19 '05 #2
On Thu, 30 Oct 2003 10:42:30 -0000, "Stuart Palmer"
<tr**********@y oucant.com> wrote:
Hi everyone,
I have a form with '/' in some of the field names, when I pass through to
the next page the field name comes back as though it's been htmlencoded, so
getting the value out of the field I need to convert this back to '/' with
the replace (same problem if I have a ',' in the name)

Is there an easy way to htmldecode or something what it converted to the
encoded versions? (I have written a short function to basically do all my
replaces for me, but I am guessing this isn't the ideal solution)


Better than a replace is simply not to name fields with any characters
other than alphanumeric. Including no spaces. Most languages have
issues with the slash and backslash, as well as quotation marks,
mathematical or comparison symbols and the like. Stick with A-Z, 0-9,
and hyphens and underscores.

Our programming convention is that field names in forms match
corresponding field names in databases, as well as variable names.
Some of us still use three letter designations, such as strLastName or
frmLastname to designate either data type or where the field
originates, but we don't mandate it.

Jeff
Jul 19 '05 #3
Good point, however I am dynamically building an email from the form and
these are the questions being processed into the output
email......'Do_ you_have_any_su ggestions/comments' it is easy to replace the
_ with spaces on the email but as the '/' and ',' are encoded, it causes me
a small problem. Like email -> strContent = fieldname & ": " &
request.form(fi eldname)

Could you suggest another way I can implement form replies into a nice
layout that the recipient can understand?

Thx

Stu

"Chris Barber" <ch***@blue-canoe.co.uk.NOS PAM> wrote in message
news:uZ******** ******@tk2msftn gp13.phx.gbl...
Not being argumentative but why would you ever want to have a form field
name with a '/' in it - it's such a patently horrible thing to have to deal with.
My suggestion: change the field names.

Chris.

"Stuart Palmer" <tr**********@y oucant.com> wrote in message
news:bn******** **@sp15at20.hur sley.ibm.com...
Hi everyone,
I have a form with '/' in some of the field names, when I pass through to
the next page the field name comes back as though it's been htmlencoded, so getting the value out of the field I need to convert this back to '/' with
the replace (same problem if I have a ',' in the name)

Is there an easy way to htmldecode or something what it converted to the
encoded versions? (I have written a short function to basically do all my
replaces for me, but I am guessing this isn't the ideal solution)

Many thanks

Stu

Jul 19 '05 #4
On Thu, 30 Oct 2003 14:48:23 -0000, "Stuart Palmer"
<tr**********@y oucant.com> wrote:
Good point, however I am dynamically building an email from the form and
these are the questions being processed into the output
email......'Do _you_have_any_s uggestions/comments' it is easy to replace the
_ with spaces on the email but as the '/' and ',' are encoded, it causes me
a small problem. Like email -> strContent = fieldname & ": " &
request.form(f ieldname)
That's not the field name, that's the input from the user. You said
your field names had a slash, not the input string. Field names
should never have a slash or quote in them. For the string input by
the user, you escape them if they will be a problem. You can also
Server.HTMLEnco de them.

Example:

Form:

<form action='emailre sults.asp'>
<P>Do you have any comments/suggestions?<in put type='text'
name='comments' id='comments' value='None'></P>
<input type="submit" name="submit" id="submit" value="Submit">
</form>

emailresults.as p:

<%
strComment = Request.Form("c omments")
Response.Write strComment
%>

This shouldn't be an issue if a slash is entered.

Jeff
Could you suggest another way I can implement form replies into a nice
layout that the recipient can understand?
"Chris Barber" <ch***@blue-canoe.co.uk.NOS PAM> wrote in message
news:uZ******* *******@tk2msft ngp13.phx.gbl.. .
Not being argumentative but why would you ever want to have a form field
name with a '/' in it - it's such a patently horrible thing to have to

deal
with.
My suggestion: change the field names.

Chris.

"Stuart Palmer" <tr**********@y oucant.com> wrote in message
news:bn******** **@sp15at20.hur sley.ibm.com...
Hi everyone,
I have a form with '/' in some of the field names, when I pass through to
the next page the field name comes back as though it's been htmlencoded,

so
getting the value out of the field I need to convert this back to '/' with
the replace (same problem if I have a ',' in the name)

Is there an easy way to htmldecode or something what it converted to the
encoded versions? (I have written a short function to basically do all my
replaces for me, but I am guessing this isn't the ideal solution)

Many thanks

Stu


Jul 19 '05 #5

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

Similar topics

4
3231
by: Eric Kincl | last post by:
Hello, its been a while since I posted/looked here... my normal email client doesn't handle newsgroups :( (ximian evolution) I was wondering how you stick a file into a database, and then retrive it again for the user with PHP/MySQL. I tried the following which apparently didnt work... Very quick overview of what I did... html
4
1886
by: ScooterMX | last post by:
I have a page that is simply a password field. Doesn't scroll, do anything other than accept a password, and has a submit button. How can I automatically place the cursor in this password field when the page loads? I think it would be really nice to just have to type the password and hit enter.
4
6805
by: Andy Hutchings | last post by:
Hi everybody - hope you can help out here. I have a form in a database, which is a columnar form from one of the tables in the db - there is a sub-form to the form which is a datasheet view of another table in the db. The LinkChilds property is set to show connected records from both tables. What I'd like to do is copy and paste, or use some other method of writing, the contents of one field in one table in the form, to a field in the...
3
1526
by: Matthew Kramer | last post by:
I sometimes have to do a lot of putting product id codes for very large tables of products in Access. Unfortunately, it's not a straightforward two-column lookup table as there are three components that make up a product id code: productname, size and color. For example, productidcode productname size color
5
2362
by: Geoff Portbury | last post by:
I'm a swimming club coach. I have a data base for recording times at various meets. I have a FORM for entering times called SWIM TIMES. When I enter the swimmers name ID, eg FOR01 for Doug Ford I want "Doug" to populate the FIRST Name field and "Ford" to populate the Last Name field. At present I have to manually enter them. I have a table called Name ID in which I have stored the swimmers ID numbers , first and last names in the...
2
1602
by: noway | last post by:
I have a report that has 2 text boxes on it. One shows the Name the other shows a count of the name. The are in their own header. My boss wants to be see all the names but depending on the time frame the names change, so I can not hard code a label with each value. Now when the report runs a I get a long list of names and counts but it takes up too much space on the report. Example
12
2868
by: James Norton-Jones | last post by:
Hi, Am I trying to hold the data of a DataGrid in a label so that when the form is reposted the DataGrid can be repopulated. The problem I am having is that I don't understand how to get the text into a stream in order to be able to use DataSetOutcomes1.ReadXML(MyStream). Thanks in advance, James
5
1674
by: Eric | last post by:
I have an access db with 6 tables. Four of them i want to merge into one table. Merging them will give me a poor design but will be much easier to work with a specific app. Performance isn't an issue. Low usage, not many rows, and being slow is ok. Before i copy and paste all the rows over, i want to put a prefix on each field so i know which table they came from. There are a LOT of fields. Is there a quick way to put a prefix on...
0
2189
by: Anish G | last post by:
Hi, I have an issue with reading CSV files. I am to reading CSV file and putting it in a Datatable in C#. I am using a regular expression to read the values. Below is the code. Now, it reads CSV file without any issues only if all the fields are not null. If any field is blank, it moves the values to the left and displays the value under invalid column. Example is shown below: A part of CSV file. I am reading the first row as...
0
8438
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
8348
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
8863
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
8779
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
8636
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
5660
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();...
0
4356
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2765
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
1761
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.