Blank lines in IE7

baal32 - May 26, 2007 - 19:02
Project:Active Select
Version:5.x-1.0
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:active
Description

Got a custom module to work with AS in Firefox but in IE7 the target list gets populated with blank lines. Note that it seems like the options array is making it into that as code as the dropdown box is resizing according to the text length (or what would be there, anyway, if the lines weren't blank) and the number of options on the target changes to what would be the correct number of options for the target.

#1

designerbrent - June 11, 2007 - 23:57

I'm using the Address CCK field (http://drupal.org/project/cck_address) and just noticed the same problem with that module in IE 7.

#2

armand0 - June 12, 2007 - 04:14

Did you already try with this? Because to my it worked me.
changing the following line 173 (approx) from activeselect.js

   --     var e = document.createEventObject();
   ++     var e = document.createEventObject('Microsoft.XMLHTTP');

#3

designerbrent - June 13, 2007 - 18:05

I tried it but it doesn't seem to work for me.

#4

olemsa - June 19, 2007 - 14:24

Change line 156 (approx) from activeselect.js

-- $(this.targets[targetIndex]).append(new Option(text, value, false, selected));

++        if (navigator.appName == "Microsoft Internet Explorer") {
++        this.targets[targetIndex].add(new Option(text, value, false, selected));
++        }else{       
++        $(this.targets[targetIndex]).append(new Option(text, value, false, selected));
++        }

#5

kaushal - June 22, 2007 - 07:00

Yes I had the same problem in IE,

   --     var e = document.createEventObject();
   ++     var e = document.createEventObject('Microsoft.XMLHTTP');

Didn't work for me But

-- $(this.targets[targetIndex]).append(new Option(text, value, false, selected));

++        if (navigator.appName == "Microsoft Internet Explorer") {
++        this.targets[targetIndex].add(new Option(text, value, false, selected));
++        }else{      
++        $(this.targets[targetIndex]).append(new Option(text, value, false, selected));
++        }

Worked for me. Thanks olemsa.

But I do have one issue with this module and I have submited an issue about it on : http://drupal.org/node/153774

Select Fields are generated fine on change event. But when I sumit the form , I get this error :
" An illegal choice has been detected. Please contact the site administrator. "
Do any of you guys facing same problem.

Thanks in advance
Regards
Kaushal

#6

bradfordcp - October 26, 2007 - 17:00

An illegal choice has been detected. Please contact the site administrator.

This is caused by not using "'#DANGEROUS_SKIP_CHECK' => TRUE," in the target's form item.

For example:

$form['section'] = array(
  '#type'                 => 'select',
  '#title'                => t('Section'),
  '#required'             => TRUE,
  '#options'              => array(0 => 'No Sections Available'),
  '#DANGEROUS_SKIP_CHECK' => TRUE,
);

#7

pcorbett - November 7, 2007 - 21:36

This worked for me as well. The state pulldown for IE 6 was empty until I applied this patch. This should definitely be applied to the next release.

#8

krunar - February 12, 2008 - 20:53

hi all,

I had the same problem with IE and the above patch workded half way for me.

- $(this.targets[targetIndex]).append(new Option(text, value, false, selected));

++        if (navigator.appName == "Microsoft Internet Explorer") {
++        this.targets[targetIndex].add(new Option(text, value, false, selected));
++        }else{     
++        $(this.targets[targetIndex]).append(new Option(text, value, false, selected));
++        }

My active select page is working fine at IE but when i print my form in a block it doesnt fire up.
To create my module i have followed the example here http://groups.drupal.org/node/3932
to build my block i do the following

if ($op == 'view') {
      $block_content = drupal_get_form('hsearch_form', $form);
      $block['subject'] = 'Search Block Subject';
      $block['content'] = $block_content;
      return $block;

i have also try building a custom block where i call my form as
<?php

return drupal_get_form('hsearch_form', $form);

?>

but again in IE its dead (the values for the first element are correct but wont change)
if anyone has any idea please help me here.
If you needed i can paste the code from the module.
Thanks

#9

krunar - February 12, 2008 - 21:20

Please ignore me...im about to do the same for myself too
i tried the patch described here http://drupal.org/node/195709
and it worked fine for both block and page. i didnt even need the patch above (they probably do the same but its too late to get smart and check it)

gb

#10

olemsa - February 13, 2008 - 11:53

They have different approaches, but both changes will most likely fix the IE problem. haven't tested #195709: <select> elements shows empty texts in IE 7.0.5730.11IC and IE 6.0

 
 

Drupal is a registered trademark of Dries Buytaert.