views:

322

answers:

5

Hello... In IE8 this

input.attr("name","exam.exam_Normal['" +normal_id_unique + "'].boolean_v");

Outputs this only in IE8....

<input propdescname="exam.exam_Normal['1'].boolean_v" type="hidden" value="0"/>

WHY WHY?? Why everywhere are problems... why

+1  A: 

The name attribute you are assigning is invalid looks strange.

I think what you may really want to do is to use the actual variable value:

input.attr("name",exam.exam_Normal[normal_id_unique].boolean_v);

Provided that variable really exists in your script.

Pekka
well i removed the ' ' and worked as i want:) thank you for the advice
Parhs
The HTML `name` attribute's content model is CDATA, not a `NAME` token (which is used for IDs). It is valid to include `[]` in `name`, and almost every PHP application does.
bobince
@bobince I stand corrected. Cheers.
Pekka
A: 

actually i have still the problem.... although i removed '' But it posts the data correctly so no problem...

Parhs
Whether there is a problem really depends on what you want to do. Does the variable `exam.exam_Normal[normal_id_unique].boolean_v`exist?
Pekka
A: 

Outputs this only in IE8....

How do you cause that to be ‘output’? Normally you only see propDescName (and submitName) when debugging the DOM in the developer tools. It is an internal detail of IE8-running-in-IE7-mode's implementation of the name attribute, that should not normally be visible to scripts.

(Setting the name attribute has notorious problems in IE up to version 7, so it's generally best avoided unless you really know what you're doing. In particular, though it correctly sets the ‘control name’ used to submit the field value, it won't affect radio-input grouping, frame targeting, or update the form[.elements] lookup.)

bobince
A: 

This error only shows up in the IE8 developer tools (F12) - in the DOM the name attribute will still be correctly set. See this post for more.

Mark