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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

text area cut & paste 1

Status
Not open for further replies.

pinny

Programmer
Jan 27, 2001
4
GB
help meeeeeeeee
when i paste text from note pad into my text area on my form
and submit it to be writen into a file.

the text is appended twice with a commer between does any body
know why ???????????


text area :

<TEXTAREA cols=&quot;40&quot; rows=&quot;6&quot; onfocus=&quot;this.form.file.select()&quot; wrap=&quot;hard&quot; name=&quot;file&quot;>#stgcontent#</TEXTAREA>

(on one line)


write to file :

write a header

<CFFILE action=&quot;WRITE&quot; file=&quot;#Application.siteRoot#\#attributes.stgwhere#\#urlencodedformat(attributes.stgheading)#.htm&quot; output=&quot;#variables.stgmetaheader#&quot; addnewline=&quot;yes&quot;>

write content from text area on line after header.

<CFFILE action=&quot;APPEND&quot; file=&quot;#Application.siteRoot#\#attributes.stgwhere#\#urlencodedformat(attributes.stgheading)#.htm&quot; output=&quot;#attributes.stgcontent#&quot; addnewline=&quot;no&quot;>
 
It sounds like your form has two inputs called &quot;file&quot; because a browser will append the values of inputs with the same name and separate them with a comma. I would be careful about using variable names such as &quot;file&quot; anyway because it's likely to be a reserved word.

I'm a little confused though because your textarea box is called &quot;file&quot; but you don't show any code that uses this value. Also, you are using &quot;attributes.&quot; as a prefix when this should only be used inside custom tags. Are these cffile statements inside a custom tag or inside the script called by your form?

GJ
 
This behaviour might also be linked to the copy-paste operation. I experienced similar problems while copy-pasting MS Word text in a TEXTAREA, then storing the value in MS Access. The pasted text mysteriously appeared twice in the database field, with a comma separating both values. It would seem that this duplication is caused when certain characters, like the apostrophe, are pasted from a Word processor. As I remember, there is a (free) custom tag somewhere in Allaire's Exchange forum which strips out such unwanted characters (search with keyword &quot;character&quot;).

Hope this helps.
 
cheers for both the responses
i do submit the form to a file and the submitted form values are passed to a function inside a module.
i think it is as jari said because the behaviour is
not consistent

pinny
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top