Closed Bug 277400 Opened 20 years ago Closed 20 years ago

doesn't render form input

Categories

(Toolkit :: Form Manager, defect)

x86
Windows XP
defect
Not set
normal

Tracking

()

RESOLVED INVALID

People

(Reporter: dicky.wahyu, Assigned: bugs)

Details

User-Agent:       Internet Explorer/4.0 (compatible; MSIE 6.0; Windows NT 5.1)
Build Identifier: Internet Explorer/4.0 (compatible; MSIE 6.0; Windows NT 5.1)

in html file with line like :
<input type="hidden" name="dodol" value="this \"is\" something">
rendered by firefox to :
<input type="hidden" name="dodol" value="this \"is\ something>


Reproducible: Always

Steps to Reproduce:
1. just try the line
<input type="hidden" name="dodol" value="this \"is\" something">
Actual Results:  
<input type="hidden" name="dodol" value="this \"is\ something>
view source by firefox

Expected Results:  
<input type="hidden" name="dodol" value="this \"is\" something">

Firefox 1.0
this looks invalid to me.

value="...." is closed after the first set of ""
if you remove the hidden you'll see an input like:
 this \

if you wish the result to be:
 this \"is\" something

then the line should be:
<input type="hidden" name="dodol" value='this \"is\" something'>
(use single quotes at to capture the value)
Summary: doesn't render form input → doesn't render form input
yes, that's true.
but source HTML should be not changed by Browser
why other browser not change it and firefox does it ?

and why this is working ...
<input type='hidden' name='test' value='test \'not\' test'>
btw, i don't need the output
but i need the value is to be passed to the next script

this is the reason why i issue this bug.
i know i have to use '..."dfsd"...' to display it

thx
I see no difference between:

<input type='hidden' name='test' value='test \'not\' test'>
and 
<input type="hidden" name="dodol" value="test \"not\" test">

Not when I remove the type="hidden" or in view source.
If view-source is the issue, please try a recent nightly build (and then resolve
the bug WORKSFORME): there have been lots of changes in view-source,
particularly handling of invalid quotes, since the 1.0 branch last April. If the
issue is with the way the value is interpreted, slashes don't escape quotes in
HTML attributes, &quot; does, so you would either need to alternate single and
double or use \&quot; to pass along a literal \", if that's your goal.
view source is one of the issues.

the important issue is that the value "can't" be passed to the next script as
usually does with other browser.

i want to have value 'this "is" test' inside "...", since the value is from
variable, and 'normally' it works.

e.g.
$variable="this \"is\" test";
echo "<input type=\"hidden\" name=\"test\" value=\"$variable\">";

i'm ok with the display, since all browsers also render same way. but "view
source" and "passing value" is not working as other browsers do.

the question "again" is why your reason is not imply to :
<input type='hidden' name='test' value='test \'not\' test'>
if this is working, why isn't same for my problem ?
is it only because " not ' ? 
Okay, last try. The view-source issue: there was a bug in the way view-source
handled invalid double-quotes in attributes. That is now fixed: your example
with double quotes shows up exactly the same way as the example with single
quotes, in a current nightly build.

However, neither one will work to submit the value |test "not" test| because
slashes do not escape quotes in HTML attributes. See
http://www.w3.org/TR/REC-html40/intro/sgmltut.html#attributes for what does and
doesn't. In short, alternate between single and double, use &#34;, or use
&quot;. value="test &quot;not&quot; test" assigns the value |test "not" test|,
value="test \"not\" test" assigns |test \| to the value attribute, and creates
two other attributes, |not| and |test|, neither of which is assigned a value.
That's the reason PHP's htmlspecialchars() function converts double-quotes to
&quot; for you. If other browsers choose to ignore the HTML spec and
misinterpret value="test\" as meaning something other than what it means,
|test\|, that's their bug.
Status: UNCONFIRMED → RESOLVED
Closed: 20 years ago
Resolution: --- → INVALID
thank you. i've tested with nightly build, and it works as it should be :D
thanks again for the answer ;-) 
Product: Firefox → Toolkit
You need to log in before you can comment on or make changes to this bug.