3

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
  • Save the ranting and describe your problem properly; what exactly is not working? It seems to output exactly what you want. Doesn't it work in other browsers or what? Or does it output propdescname when you try to put name? Commented Mar 24, 2010 at 9:48

4 Answers 4

4

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.

Sign up to request clarification or add additional context in comments.

Comments

1

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.

2 Comments

well i removed the ' ' and worked as i want:) thank you for the advice
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.
1

Don't worry, just like said bobince that attribute name displays only in the IE8 developer tool. The real DOM attribute will be exactely the attribute you assigned.

Comments

0

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.)

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.