views:

9

answers:

1

Hi all. I have a js function named "GetListColumnValue". This function causes some problems with IE6. Is there any way to avoid the problem? (I thnk the problem is occured because of the concat) Here is the code sample. The last line is my solution which I am not sure that it works well. Any suggestions? Thanks.

function GetListColumnValue(listName, columnName) {
    return document.getElementById(listName + "_" + columnName).value;
}
var DISCOUNT_QUANTITY = GetListColumnValue("lstRecords", "DISCOUNT_QUANTITY"); 

var DISCOUNT_QUANTITY = document.getElementById("lstRecords_DISCOUNT_QUANTITY");
A: 

IE6 has many many problems, but simple JS string concat isn't one of them. I don't think that's your problem.

You didn't specify what exactly the problem is, but looking at the two code samples you provided, they will do different things:

The first one (ie the function) returns the object.value, whereas the second one (ie setting it directly), you've just returned the object.

So the two code blocks set DISCOUNT_QUANTITY to different things. If you remove the .value from the function, it should work exactly the same as the other code block.

Hope that helps.

Spudley