Author |
Topic |
|
Syedur
New Member
USA
93 Posts |
Posted - 22 June 2001 : 01:34:22
|
Did anyone noticed that... When you have something around double quotes in the subject line... Later on, when you try to edit the topic (as a mod/admin), the subject line doesn't have the words visible after the quotes... Try editing my post's subject... Thanks.
There is a time in every man’s education when he arrivers at the conviction that envy is ignorance; that imitation is suicide. |
|
work mule
Senior Member
USA
1358 Posts |
Posted - 22 June 2001 : 17:49:59
|
Hmm...I checked the beta and it's still not working there either.
Basically, whenever someone types doublequotes into an input box and then is allowed to edit it later, if it has the doublequotes, then the text appears to be truncated at that spot.
If someone with rights to edit the topics at either one of these sites looks at the subject line upon edit, you'll see it gets truncated.
She said, "Send me flowers!"
appears as
She said,
because the html is now
<input maxLength="50" name="Subject" value="She said, "Send me flowers!"" size="40">
So the browser sees that second doublequote and thinks the attribute value stops there.
Beta Snitz http://forum.snitz.com/beta/v33/topic.asp?TOPIC_ID=22
Current Snitz http://forum.snitz.com/forum/link.asp?TOPIC_ID=11819
The Work Mule Forums The Writer Community
|
|
|
gor
Retired Admin
Netherlands
5511 Posts |
Posted - 22 June 2001 : 17:57:55
|
So in this case we should make a difference between displaying a string as part of plain HTML and as part of a formelement. In the case of a input element we need to replace " with "" (but not ' with '') when it is displayed.
Correct ?
Pierre Join the Snitz WebRing |
|
|
work mule
Senior Member
USA
1358 Posts |
Posted - 22 June 2001 : 18:06:32
|
Well, it's only for input form elements. The textarea uses the tags to start and end, while the input form element uses the " to mark the start and end of the attribute value. This applies to hidden tags also.
If you use " to mark attributes then you have to convert ", but if you use the ' then you have to convert that mark. So it depends on how you mark your attributes.
I think all you have to do is the following, depending on which character you use to mark attributes. It's similiar to the idea of escaping characters in Javascript or Perl, but the HTML way. " to & #034; ' to & #039;
(I had to put a space between the & and # to get it to show.)
quote:
And, like I asked at the other topic: did you ?
No, but if I spend too much time here, I'll have to.
The Work Mule Forums The Writer Community
Edited by - work mule on 22 June 2001 18:08:00 |
|
|
work mule
Senior Member
USA
1358 Posts |
Posted - 22 June 2001 : 18:53:31
|
Maybe something like this, but take the spaces out after the ampersand (&) for the HTML entity code.
function FormEncode(ByVal fString) If IsNull(fString) Then exit function fString = replace(fString, ">", "& gt;") fString = replace(fString, "<", "& lt;") fString = replace(fString, chr(34), "& #034;")
FormEncode = fString end function
The Work Mule Forums The Writer Community
|
|
|
RichardKinser
Snitz Forums Admin
USA
16655 Posts |
Posted - 22 June 2001 : 19:27:06
|
What I did was add this to the Chkstring function:
if fField_Type = "edit" then if strAllowHTML <> "1" then fString = HTMLEncode(fString) end if fString = Replace(fString, """", """) ChkString = fString exit function end if
And this is how it looks in post.asp:
<td bgColor="<% =strPopUpTableColor %>"><input maxLength="50" name="Subject" value="<% =Trim(ChkString(TxtSub,"edit")) %>" size="40"></td>
You can try it HERE
Just login as NewUser/newuser and then edit the message. |
|
|
HuwR
Forum Admin
United Kingdom
20584 Posts |
Posted - 25 June 2001 : 12:14:12
|
Implemented in current source
|
|
|
|
Topic |
|