Skip to content
Snippets Groups Projects
Commit a20714dc authored by Tor-Einar Skog's avatar Tor-Einar Skog
Browse files

Fixing selecting cropCategories in iE

parent 050be1e1
No related branches found
No related tags found
No related merge requests found
...@@ -729,7 +729,9 @@ function restoreSelectedCropCategoryIds() ...@@ -729,7 +729,9 @@ function restoreSelectedCropCategoryIds()
if(selectedCropCategoryIds != null) if(selectedCropCategoryIds != null)
{ {
// Loop through existing crops, set as checked/unchecked // Loop through existing crops, set as checked/unchecked
formFields = document.getElementsByName("cropCategoryIds"); // Since this is an HTMLCollection, we must do some magic
formFields = [].slice.call(document.getElementsByName("cropCategoryIds"));
for(i in formFields) for(i in formFields)
{ {
if(formFields[i].value == undefined) if(formFields[i].value == undefined)
...@@ -739,6 +741,7 @@ function restoreSelectedCropCategoryIds() ...@@ -739,6 +741,7 @@ function restoreSelectedCropCategoryIds()
var previouslySelected = false; var previouslySelected = false;
for(var j in selectedCropCategoryIds) for(var j in selectedCropCategoryIds)
{ {
// Need to use eval() as values are strings with [] representing arrays // Need to use eval() as values are strings with [] representing arrays
if(parseInt(formFields[i].value) == parseInt(selectedCropCategoryIds[j])) if(parseInt(formFields[i].value) == parseInt(selectedCropCategoryIds[j]))
{ {
......
...@@ -149,7 +149,7 @@ function storeLocalSettings(settingsDict) ...@@ -149,7 +149,7 @@ function storeLocalSettings(settingsDict)
{ {
return; return;
} }
for(var key in settingsDict) for(var key in settingsDict)
{ {
if(! settingsDict.hasOwnProperty(key)) if(! settingsDict.hasOwnProperty(key))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment