Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

submitted form data saving as 'funny' characters

Status
Not open for further replies.

1DMF

Programmer
Jan 18, 2005
8,795
GB
Hi,

Can someone tell me why a textarea form data ...
App 1 – sum assured to include existing mortgage (£110k) plus new mortgage (£150k) – existing policy has been retained (also £110k) and new policy applied for is £260k therefore client will have total life cover of £370k?

ends up in SQL like this...
App 1 – sum assured to include existing mortgage (£110k) plus new mortgage (£150k) – existing policy has been retained (also £110k) and new policy applied for is £260k therefore client will have total life cover of £370k?

the data from the textarea is submitted via AJAX and escape() is used on the data first.

Is the Javascript 'escape' command corrupting the data?

"In complete darkness we are all the same, only our knowledge and wisdom separates us, don't let your eyes deceive you."

"If a shortcut was meant to be easy, it wouldn't be a shortcut, it would be the way!"

Google Rank Extractor -> Perl beta with FusionCharts
 
Hi Chris,

I think SQL is ok, as the MS access DB front end system we have dosen't have an issue.

perhaps it's perl, but I am using the standard CGI module for handling STDIN

I'll ask in the perl forum and see what they think.

could it be the charset on the webpage?

"In complete darkness we are all the same, only our knowledge and wisdom separates us, don't let your eyes deceive you."

"If a shortcut was meant to be easy, it wouldn't be a shortcut, it would be the way!"

Google Rank Extractor -> Perl beta with FusionCharts
 
I'd put money on the fact that that content was pasted from Word. The em-dash (or possibly en-dash) needs converting to a character entity.

Personally, I'd either:

1) Do this all server side, or
2) Replace it with a regular hyphen.

Hope this helps,
Dan



Coedit Limited - Delivering standards compliant, accessible web solutions

Dan's Page [blue]@[/blue] Code Couch:
Code Couch Snippets & Info:
The Out Atheism Campaign
 
I'd tend to agree, the hyphens look like those extra long ones word creates!

1. Do you mean convert it server side.

2. Do you know the codes Javascript would see for me to do a replace?

"In complete darkness we are all the same, only our knowledge and wisdom separates us, don't let your eyes deceive you."

"If a shortcut was meant to be easy, it wouldn't be a shortcut, it would be the way!"

Google Rank Extractor -> Perl beta with FusionCharts
 
Data should always be checked & escaped serverside
even if the client is checking the data 1st

Data recived from the clien should never be trusted as it can easily be faked or tampered with.
 
not in a staff admin extranet that is SSL encoded and only staff can use it!

Compliance officers don't fake content!

But I understand where you are coming from, but my environment is slightly more controllable than just WWW!

"In complete darkness we are all the same, only our knowledge and wisdom separates us, don't let your eyes deceive you."

"If a shortcut was meant to be easy, it wouldn't be a shortcut, it would be the way!"

Google Rank Extractor -> Perl beta with FusionCharts
 
not in a staff admin extranet that is SSL encoded and only staff can use it!

Compliance officers don't fake content!

But I understand where you are coming from, but my environment is slightly more controllable than just WWW!

Doesn't mean you shouldn't follow good practices...

What happens if/when you start working in another environment? "Bad habits" from one will carry over to the other...

I've worked with people recently who don't have a clue on how to make their site cross browser friendly because at their last job they worked mainly on an intranet site and their company was forced to use IE 6 in a Windows environment - no updates to 7 or 8, no support for firefox, chrome, safari...needless to say, the relationships didn't last long...




--------

GOOGLE is a great resource to find answers to questions like "how do i..."


--------
 
Hey you don't need to preach valid, semantic, good practice coding to me, I learnt from the best!

I'm just saying in the curent environment, Javascript validation is acceptable to cut down developement time.

You work to the environment you are in and the constraints of the project.

Just because I use Javascript to do something, doesn't mean I don't try to write maintainable, easy to read code, commented and formated to accepted standards.

But don't worry, I do listen to the advice given here, that's why I come here, and I'm already on the case looking for a Perl solution ;-)



"In complete darkness we are all the same, only our knowledge and wisdom separates us, don't let your eyes deceive you."

"If a shortcut was meant to be easy, it wouldn't be a shortcut, it would be the way!"

Google Rank Extractor -> Perl beta with FusionCharts
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top