1
Cuidiu
Notifications Checkbox
  • 2006/7/31 23:53

  • Cuidiu

  • Quite a regular

  • Posts: 358

  • Since: 2006/4/23


Using Firefox, I get a JavaScript error when trying to use the check all checkbox in user notifications (/notifications.php). It also happens on xoops.org site. If I use IE, the checkall box seems to work properly. Can someone help me correct this?

JavaScript Error: switch_cbox has no properties
File referenced: xoops.js line 140
Here is the code (line 140 marked in red):
function xoopsCheckGroup(formnameswitchidgroupid) {
    var 
ele document.forms[formname].elements;
    var 
switch_cbox xoopsGetElementById(switchid);
    for (var 
0ele.lengthi++) {
        var 
ele[i];
        if ( (
e.type == 'checkbox') && (e.id == groupid) ) {
            [
color=CC0000]e.checked switch_cbox.checked;[/color]
            
e.click(); e.click();  // Click to activate subgroups
                                    // Twice so we don't reverse effect
        
}
    }
}{

Thanks.
[size=x-small]Working sites:
XOOPS 2.0.16 PHP 5.2.2, MySQL 5.0.24a-standard-log, Apache/2.0.54 (Unix)
XOOPS 2.2.4, PHP 4.3.10, MySQL 3.23.58, Apache/1.3.33 (Unix)[/size]

2
Cuidiu
Re: Notifications Checkbox
  • 2006/8/2 0:08

  • Cuidiu

  • Quite a regular

  • Posts: 358

  • Since: 2006/4/23


I just tested in Netscape 7.x and the checkbox is not working properly there either.

I'm trying to understand why no one has replied. Does everyone here use Internet Explorer? Or is no one else seeing this issue?
[size=x-small]Working sites:
XOOPS 2.0.16 PHP 5.2.2, MySQL 5.0.24a-standard-log, Apache/2.0.54 (Unix)
XOOPS 2.2.4, PHP 4.3.10, MySQL 3.23.58, Apache/1.3.33 (Unix)[/size]

3
skenow
Re: Notifications Checkbox
  • 2006/8/2 1:15

  • skenow

  • Home away from home

  • Posts: 993

  • Since: 2004/11/17


The object model is different between IE and FF/Netscape. FF and Netscape will also use Java for scripting, not JavaScript, which is specific to Microsoft.

As others have noted elsewhere in the forums, a response to your specific question may take a while to research if it isn't be encountered by someone else.

Something to keep in mind with FF - it caches more than IE. If xoops.js has changed (upgrades, hacks, whatever), FF may still be caching an old copy.

As an observation, I would guess that most of the people who could answer your question don't use IE as their default browser, but have it as an alternative for testing.

You failed to mention which version of XOOPS - should we assume the information you have in you signature?

4
Cuidiu
Re: Notifications Checkbox
  • 2006/8/2 1:51

  • Cuidiu

  • Quite a regular

  • Posts: 358

  • Since: 2006/4/23


Quote:
skenow wrote:
The object model is different between IE and FF/Netscape. FF and Netscape will also use Java for scripting, not JavaScript, which is specific to Microsoft.

That's good to know. Thanks.

Quote:
As others have noted elsewhere in the forums, a response to your specific question may take a while to research if it isn't be encountered by someone else.

I can appreciate that.

Quote:
Something to keep in mind with FF - it caches more than IE. If xoops.js has changed (upgrades, hacks, whatever), FF may still be caching an old copy.

It is happening on this site as well as two other sites. Sorry, my inexperience is showing as I'm not sure what your point is about caching. It appears to have been there as long as I've been working in XOOPS and using the same version, different sites.

Quote:
As an observation, I would guess that most of the people who could answer your question don't use IE as their default browser, but have it as an alternative for testing.

That's good to know.

Quote:
You failed to mention which version of XOOPS - should we assume the information you have in you signature?

That's why I have it in my signature. If I were using a different version I'd post it. It is happening on both sites, different servers. And as I said, it happens on this site also.

Thanks for your reply.
[size=x-small]Working sites:
XOOPS 2.0.16 PHP 5.2.2, MySQL 5.0.24a-standard-log, Apache/2.0.54 (Unix)
XOOPS 2.2.4, PHP 4.3.10, MySQL 3.23.58, Apache/1.3.33 (Unix)[/size]

5
skenow
Re: Notifications Checkbox
  • 2006/8/2 3:22

  • skenow

  • Home away from home

  • Posts: 993

  • Since: 2004/11/17


I went right by the mention of xoops.org having the same behavior. You're right - it works in IE, not in FF. There is something in the xoopsGetElementById function that isn't producing the correct information in FF.

This would qualify as a bug

6
Cuidiu
Re: Notifications Checkbox
  • 2006/8/2 3:27

  • Cuidiu

  • Quite a regular

  • Posts: 358

  • Since: 2006/4/23


Thanks skenow. It's good to know it isn't just me. I spend a lot of time on those "it only happens for me" things so it's nice to know this isn't one of them.

Quote:
skenow wrote:
I went right by the mention of xoops.org having the same behavior. You're right - it works in IE, not in FF. There is something in the xoopsGetElementById function that isn't producing the correct information in FF.

This would qualify as a bug
[size=x-small]Working sites:
XOOPS 2.0.16 PHP 5.2.2, MySQL 5.0.24a-standard-log, Apache/2.0.54 (Unix)
XOOPS 2.2.4, PHP 4.3.10, MySQL 3.23.58, Apache/1.3.33 (Unix)[/size]

7
metropolis
Re: Notifications Checkbox
  • 2006/8/2 10:39

  • metropolis

  • Not too shy to talk

  • Posts: 159

  • Since: 2004/7/15


Quote:

Cuidiu wrote:
Quote:
skenow wrote:
The object model is different between IE and FF/Netscape. FF and Netscape will also use Java for scripting, not JavaScript, which is specific to Microsoft.

That's good to know. Thanks.

Which is - of course - nonsense. Java and JavaScript are totally different languages and JavaScript can be used in IE or Firefox, though some objects are different.

8
skenow
Re: Notifications Checkbox
  • 2006/8/4 2:06

  • skenow

  • Home away from home

  • Posts: 993

  • Since: 2004/11/17


Quote:

metropolis wrote:
Quote:

Cuidiu wrote:
Quote:
skenow wrote:
The object model is different between IE and FF/Netscape. FF and Netscape will also use Java for scripting, not JavaScript, which is specific to Microsoft.

That's good to know. Thanks.

Which is - of course - nonsense. Java and JavaScript are totally different languages and JavaScript can be used in IE or Firefox, though some objects are different.


Which is why I started by stating the object model is different. The remainder of my statement referred to the default interpreter for each browser - MS uses theirs, while others use Sun Java Console.

9
Cuidiu
Re: Notifications Checkbox
  • 2006/10/4 0:22

  • Cuidiu

  • Quite a regular

  • Posts: 358

  • Since: 2006/4/23


I am still looking for a fix for this. Is it too complicated to fix the javascript? I have 2 corporate clients who are asking me why there are checkboxes that don't work (you'd think they wouldn't notice!) and I'm not sure how to answer. Help, anyone?

Quote:
Cuidiu wrote:
Using Firefox, I get a JavaScript error when trying to use the check all checkbox in user notifications (/notifications.php). It also happens on xoops.org site. If I use IE, the checkall box seems to work properly. Can someone help me correct this?

JavaScript Error: switch_cbox has no properties
File referenced: xoops.js line 140
Here is the code (line 140 marked in red):
function xoopsCheckGroup(formnameswitchidgroupid) {
    var 
ele document.forms[formname].elements;
    var 
switch_cbox xoopsGetElementById(switchid);
    for (var 
0ele.lengthi++) {
        var 
ele[i];
        if ( (
e.type == 'checkbox') && (e.id == groupid) ) {
            [
color=CC0000]e.checked switch_cbox.checked;[/color]
            
e.click(); e.click();  // Click to activate subgroups
                                    // Twice so we don't reverse effect
        
}
    }
}{

Thanks.
[size=x-small]Working sites:
XOOPS 2.0.16 PHP 5.2.2, MySQL 5.0.24a-standard-log, Apache/2.0.54 (Unix)
XOOPS 2.2.4, PHP 4.3.10, MySQL 3.23.58, Apache/1.3.33 (Unix)[/size]

10
iHackCode
Re: Notifications Checkbox

hmm. i've never noticed this post before..

well i hope this works/helps you.

its the template..
system_notification_list.html (here is what 2.0.15 should look like)
<h4><{$lang_activenotifications}>h4>
<
form name="notificationlist" action="notifications.php" method="post">
<
table class="outer">
  <
tr>
    <
th><input name="allbox" id="allbox" onclick="xoopsCheckAll('notificationlist', 'allbox');" type="checkbox" value="<{$lang_checkall}>" />th>
    <
th><{$lang_event}>th>
    <
th><{$lang_category}>th>
    <
th><{$lang_itemid}>th>
    <
th><{$lang_itemname}>th>
  tr>
  <{foreach 
item=module from=$modules}>
  <
tr>
    <
td class="head"><input name="del_mod[<{$module.id}>]" id="del_mod[<{$module.id}>]" onclick="xoopsCheckGroup('notificationlist', 'del_mod[<{$module.id}>]', 'del_not[<{$module.id}>][]');" type="checkbox" value="<{$module.id}>" />td>
    <
td class="head" colspan="4"><{$lang_module}>: <{$module.name}>td>
  tr>
  <{foreach 
item=category from=$module.categories}>
  <{foreach 
item=item from=$category.items}>
  <{foreach 
item=notification from=$item.notifications}>
  <
tr>
    <{
cycle values=odd,even assign=class}>
    <
td class="<{$class}>"><input type="checkbox" name="del_not[<{$module.id}>][]" id="del_not[<{$module.id}>][]" value="<{$notification.id}>" />td>
    <
td class="<{$class}>"><{$notification.event_title}>td>
    <
td class="<{$class}>"><{$notification.category_title}>td>
    <
td class="<{$class}>"><{if $item.id != 0}><{$item.id}><{/if}>td>
    <
td class="<{$class}>"><{if $item.id != 0}><{if $item.url != ''}><a href="<{$item.url}>"><{/if}><{$item.name}><{if $item.url != ''}>a><{/if}><{/if}>td>
  tr>
  <{/foreach}>
  <{/foreach}>
  <{/foreach}>
  <{/foreach}>
  <
tr>
    <
td class="foot" colspan="5">
      <
input type="submit" name="delete_cancel" value="<{$lang_cancel}>" />
      <
input type="reset" name="delete_reset" value="<{$lang_clear}>" />
      <
input type="submit" name="delete" value="<{$lang_delete}>" />
      <
input type="hidden" name="XOOPS_TOKEN_REQUEST" value="<{$notification_token}>" />
    td>
  tr>
table>
form>


what i changed.whats in GREEN i added, and whats in RED i took out
<h4><{$lang_activenotifications}>h4>
<
form name="notificationlist" action="notifications.php" method="post">
<
table class="outer">
  <
tr>
    [
color=CC0000]<th><input name="allbox" id="allbox" onclick="xoopsCheckGroup('notificationlist', 'allbox', 'del_mod[]');" type="checkbox" value="<{$lang_checkall}>" />th>[/color]
[
color=009900]<th><input name="allbox" id="allbox" onclick="xoopsCheckAll('notificationlist', 'allbox');" type="checkbox" value="<{$lang_checkall}>" />th>[/color]
    <
th><{$lang_event}>th>
    <
th><{$lang_category}>th>
    <
th><{$lang_itemid}>th>
    <
th><{$lang_itemname}>th>
  tr>
  <{foreach 
item=module from=$modules}>
  <
tr>
    <
td class="head"><input name="del_mod[<{$module.id}>]" id="del_mod[ [color=009900]<{$module.id}>[/color] ]" onclick="xoopsCheckGroup('notificationlist', 'del_mod[<{$module.id}>]', 'del_not[<{$module.id}>][]');" type="checkbox" value="<{$module.id}>" />td>
    <
td class="head" colspan="4"><{$lang_module}>: <{$module.name}>td>
  tr>


XooPS Bug.. I Guess.. Submitted!
CBB / LatestNews / Publisher / XM-Spotlight

(ノ◕ヮ◕)ノ*:・゚✧

Login

Who's Online

327 user(s) are online (282 user(s) are browsing Support Forums)


Members: 0


Guests: 327


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Nov 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits