Edgewall Software
Modify

Opened 17 years ago

Closed 17 years ago

Last modified 17 years ago

#6778 closed defect (duplicate)

Custom checkbox field not selectable in IE

Reported by: peter@… Owned by: Matthew Good
Priority: normal Milestone:
Component: report system Version: 0.10.4
Severity: normal Keywords:
Cc: Branch:
Release Notes:
API Changes:
Internal Changes:

Description

I have added a custom ticket field which is a simple checkbox by adding the following section to the trac.ini:

[ticket-custom]
tested = checkbox
tested.label = Testing completed
tested.value = 0

When using the Custom Query this field is available for selection from the Add Filter combo box. If you are using Internet Explorer (only tested using IE7) the field appears with radio buttons for Yes and No but they are not selectable.

When the update button is clicked the fields options disappear, even though any other selected fields remain visible.

Adding this filter works fine with Firefox, the Yes and No options are both selectable and remain visible after an update.

Attachments (1)

trac-ie-dynamic-radio-fix.diff (958 bytes ) - added by Paul Irish <paul.irishEWWSPAM@…> 17 years ago.
revised radio button creation using innerHTML

Download all attachments as: .zip

Change History (5)

comment:1 by osimons, 17 years ago

Milestone: 0.11.1

The Trac javascript code creates the table elements and the various fields as required. I have reviewed the relevant parts, and it looks correct and behaves correctly in Firefox as you say.

However, viewing the DOM source with IE Developer Toolbar it shows this - clearly missing the name="tested" attribute that is supposed to name and group these two radio buttons:

<TD class="filter" colSpan="2">
  <INPUT id="tested_on" type="radio" value="1" />
  <LABEL for="tested_on">yes</LABEL>
  <INPUT id="tested_off" type="radio" value="0" />
  <LABEL for="tested_off">no</LABEL>
</TD>

Tested using an up-to-date IE7. Verified bug using 0.11b1+, so it is not related to Trac version.

It feels like (another) IE bug…

comment:2 by osimons, 17 years ago

Looks like it:

http://webbugtrack.blogspot.com/2007/10/bug-235-createelement-is-broken-in-ie.html

This modification makes it work:

  • trac/htdocs/js/query.js

     
    130130
    131131    // Convenience function for creating an <input type="radio">
    132132    function createRadio(name, value, id) {
    133       var input = document.createElement("input");
     133      if (!$.browser.msie) {
     134        var input = document.createElement("input");
     135      } else {
     136        var input = document.createElement('<input name="'+name+'"/>');
     137      }
    134138      input.type = "radio";
    135139      if (name) input.name = name;
    136140      if (value) input.value = value;}}}

Should we update the js createElement() code to use this quirky workaround, or any better ideas? Does jQuery contain a useful multi-browser 'create' method? Hmm. I better start reading up on jQuery, I suppose…

comment:3 by osimons, 17 years ago

Milestone: 0.11.1
Resolution: duplicate
Status: newclosed

Turns out to be a duplicate - not surprising really as the bug seems to have been there for a long time.

Closing as duplicate of #3014.

by Paul Irish <paul.irishEWWSPAM@…>, 17 years ago

revised radio button creation using innerHTML

in reply to:  1 comment:4 by Paul Irish <paul.irishEWWSPAM@…>, 17 years ago

oops. wrong ticket.

btw, osimons- the jQuery syntax for element creation is simply $('<input type="radio" name="foo"/>) — It's just putting a string of abitrary html as the primary argument. It'll be constructed into the neccessary DOM nodes. IMO, it wouldn't work well here unless we redid a big chunk of it.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Matthew Good.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from Matthew Good to the specified user.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.