toggle ? Javascript Checkbox issue

Discussions and Tech Support specific to the iMacros Firefox add-on.
Forum rules
Before asking a question or reporting an issue:
1. Please review the list of FAQ's.
2. Use the search box (at the top of each forum page) to see if a similar problem or question has already been addressed.
3. Try searching the iMacros Wiki - it contains the complete iMacros reference as well as plenty of samples and tutorials.
4. We can respond much faster to your posts if you include the following information: CLICK HERE FOR IMPORTANT INFORMATION TO INCLUDE IN YOUR POST
Post Reply
additional001
Posts: 175
Joined: Sun Jul 06, 2008 3:24 am

toggle ? Javascript Checkbox issue

Post by additional001 » Fri Jul 25, 2008 2:28 pm

There seems to be an issue in iMacro when clicking on a Javascript toggle checkbox. My issue is that on the page it will check the box, but it does not bring up the content its supposed to. When you use the mouse to check or un-check the boxes the content refreshes as expected. I was able to isolate the javascript from the site's source. I will include it here

Code: Select all

    <td class="notificationsMenuContainer">
      <div class="notificationsMenu">
        <div class="notificationsMenuHeader">Show these notifications...</div>
        <ul>
          <li class="goldstar">
            <input type="checkbox" class="toggle" id="goldstarToggle" onclick="Notification.toggleFilter( 'goldstar' );"/>

            <label for="goldstarToggle">Gold Stars</label>
          </li>
          <li class="friend">
            <input type="checkbox" class="toggle" id="friendToggle" onclick="Notification.toggleFilter( 'friend' );"/>
            <label for="friendToggle">Friendships</label>
          </li>
          <li class="yearbook">
            <input type="checkbox" class="toggle" id="yearbookToggle" onclick="Notification.toggleFilter( 'yearbook' );"/>

            <label for="yearbookToggle">Autographs</label>
          </li>
          <li class="gift">
            <input type="checkbox" class="toggle" id="giftToggle" onclick="Notification.toggleFilter( 'gift' );"/>
            <label for="giftToggle">Gifts</label>
          </li>
          <li class="highfive">
            <input type="checkbox" class="toggle" id="highfiveToggle" onclick="Notification.toggleFilter( 'highfive' );"/>

            <label for="highfiveToggle">High Fives</label>
          </li>
          <li class="flirt">
            <input type="checkbox" class="toggle" id="flirtToggle" onclick="Notification.toggleFilter( 'flirt' );"/>
            <label for="flirtToggle">Flirts</label>
          </li>
          <li class="battle">
            <input type="checkbox" class="toggle" id="battleToggle" onclick="Notification.toggleFilter( 'battle' );"/>

            <label for="battleToggle">Battles</label>
          </li>
          <li class="hot">
            <input type="checkbox" class="toggle" id="hotToggle" onclick="Notification.toggleFilter( 'hot' );"/>
            <label for="hotToggle">Hot</label>
          </li>
          <li class="comment">
            <input type="checkbox" class="toggle" id="commentToggle" onclick="Notification.toggleFilter( 'comment' );"/>

            <label for="commentToggle">Comments</label>
          </li>
          <li class="auction">
            <input type="checkbox" class="toggle" id="auctionToggle" onclick="Notification.toggleFilter( 'auction' );"/>
            <label for="auctionToggle">Auctions</label>
          </li>
          <li class="family">
            <input type="checkbox" class="toggle" id="familyToggle" onclick="Notification.toggleFilter( 'family' );"/>

            <label for="familyToggle">Family</label>
          </li>
          <li class="groupie">
            <input type="checkbox" class="toggle" id="groupieToggle" onclick="Notification.toggleFilter( 'groupie' );"/>
            <label for="groupieToggle">Groupies</label>
          </li>
          <li class="group">
            <input type="checkbox" class="toggle" id="groupToggle" onclick="Notification.toggleFilter( 'group' );"/>

            <label for="groupToggle">Groups</label>
          </li>
          <li class="status">
            <input type="checkbox" class="toggle" id="statusToggle" onclick="Notification.toggleFilter( 'status' );"/>
            <label for="statusToggle">Status</label>
          </li>
        </ul>
      </div>

      <div class="notificationMenuLinks">
            Select: <a href="#" onclick="Notification.selectAll(); return false;">all</a> | <a href="#" onclick="Notification.selectNone(); return false;">none</a></div>
My Firefox version is 3.0.1 iMacro's version is VERSION BUILD=6050612 or 6.0.5.4(reported by FF's Add on manager) Here is the code for the script. Sorry for the larger font I'm visually challenged. Any help or information would be greatly appreciated.

Code: Select all

TAG POS=1 TYPE=A ATTR=ONCLICK:Notification.selectNone();*
WAIT SECONDS=5
TAG POS=1 TYPE=INPUT:CHECKBOX FORM=NAME:NoFormName ATTR=ID:goldstarToggle CONTENT=YES
User avatar
Tech Support
Posts: 4947
Joined: Tue Sep 20, 2005 7:25 pm
Contact:

Re: toggle ? Javascript Checkbox issue

Post by Tech Support » Fri Jul 25, 2008 3:12 pm

Can you please test with the V6.0.6.5 Beta version?

If this does not help, can you please post the URL of the web page and/or the macro that creates the problem? This would allow us to quickly re-create the issue on our test systems. If the problem occurs on a non-public web site, the second best solution is if you can attach a screenshot to your post.
additional001
Posts: 175
Joined: Sun Jul 06, 2008 3:24 am

Re: toggle ? Javascript Checkbox issue

Post by additional001 » Fri Jul 25, 2008 3:49 pm

Tech Support wrote:Can you please test with the V6.0.6.5 Beta version?
Could you please supply a URL for the beta download? I can't seem to find mention of this new beta. I will gladly test with the beta.
Tech Support wrote: If this does not help, can you please post the URL of the web page and/or the macro that creates the problem? This would allow us to quickly re-create the issue on our test systems.


This is a very public website. http://www.myyearbook.com/apps/messages/notification is the URL but you need a user account and a few basic things to have happen before its recreatable. I'm thinking you'll prob want screen shots instead. No prob there after I get a link and get the beta... I'll poste those if it's not resolved. Thanks!
additional001
Posts: 175
Joined: Sun Jul 06, 2008 3:24 am

Re: toggle ? Javascript Checkbox issue

Post by additional001 » Fri Jul 25, 2008 4:14 pm

I found a link for the beta in the Wiki Version history so I installed it and ran the previous script I made

FF Version=3.0.1
iMacros Version=6.0.6.5

After upgrading to the beta I ran the previous script and encountered an error(Old code and error will follow).

Code: Select all

TAG POS=1 TYPE=A ATTR=ONCLICK:Notification.selectNone();*
WAIT SECONDS=5
TAG POS=1 TYPE=INPUT:CHECKBOX FORM=NAME:NoFormName ATTR=ID:goldstarToggle CONTENT=YES

Code: Select all

Exception... "Component is not available" nsresult: "0x80040111 (NS_ERROR_NOT_AVAILABLE)" location: "JS frame :: chrome://imacros/content/MacroPlayer.js :: anonymous :: line 5" data: no], macro line 4
After making a slight change in the script I was able to eliminate the error(code to follow)

Code: Select all

TAG POS=1 TYPE=A ATTR=TXT:none
WAIT SECONDS=5
TAG POS=1 TYPE=INPUT:CHECKBOX FORM=NAME:NoFormName ATTR=ID:goldstarToggle CONTENT=YES
I'm unclear as to why the first script's first line worked in imarcro's 6.0.6.4 but did not in 6.0.6.5. At any rate I was able to circumnavigate the error. Moving on.. Below are some screen shots I took of what the websites function is vrs what the script does. I hope this helps.

Image

The sites default is that all of the checkboxes are checked and all of the content is shown. Above shot is that the mouse behavior. Step one None is clicked and the and all the content is removed. Step 2, when clicked shows the "Gold Stars" received.

Image

This shot is taken just after the script is run. You can see from the indicator that none was selected and that indeed content did go away. In Step 2 you can see that the script did indeed check the Gold Stars checkbox, but no content was revealed(refreshed?) Any suggestions or help is again greatly appreciated.
additional001
Posts: 175
Joined: Sun Jul 06, 2008 3:24 am

Re: toggle ? Javascript Checkbox issue

Post by additional001 » Wed Jul 30, 2008 7:12 pm

Still working on this one... now testing with FF 3.01 and iMacros 6.0.6.8.

Using the recorded I am now using this

Code: Select all

TAG POS=1 TYPE=A ATTR=ONCLICK:Notification.selectNone();<SP>return<SP>false;&&HREF:http://www.myyearbook.com/apps//messages/notification#&&TXT:none
TAG POS=1 TYPE=INPUT:CHECKBOX ATTR=ID:goldstarToggle CONTENT=YES
The behavior of the script is still the same as that in the second screenshot posted above, however I do get a the following error

Code: Select all

[Exception... "Component is not available"  nsresult: "0x80040111 (NS_ERROR_NOT_AVAILABLE)"  location: "JS frame :: chrome://imacros/content/MacroPlayer.js :: anonymous :: line 5"  data: no], line 4
Can someone translate that into English and offer suggestions?
SO333
Posts: 11
Joined: Thu Apr 03, 2008 11:40 am

Re: toggle ? Javascript Checkbox issue

Post by SO333 » Mon Sep 22, 2008 4:21 pm

I have the same problem with a checkbox "CheckAll".

In my case, the checkbox "CheckAll" uses JavaScript to select/enable other checkboxes. IMacros, however, seems to ignore the underlying JavaScript and only highlights the checkbox "CheckAll", but does not execute the JavaScript. Is this problem known, and will it be fixed in a further version?
additional001
Posts: 175
Joined: Sun Jul 06, 2008 3:24 am

Re: toggle ? Javascript Checkbox issue

Post by additional001 » Wed Sep 24, 2008 7:15 am

SO333 Good luck... this issue is still present for me as well and I run the latest iMacros for FF..even the betas. I never received any other info on this. In fact I pretty much get ignored by Tech Support on 99% of the stuff I post.
imarcomonkey
Posts: 1
Joined: Sun Sep 28, 2008 7:07 pm

Re: toggle ? Javascript Checkbox issue

Post by imarcomonkey » Sun Sep 28, 2008 7:13 pm

I was able to work around this problem on a similar page by adding a line to execute the javascript after the TAG that checks the select box.

I didn't try it on this site, but see if this works for you:
URL GOTO=javascript: Notification.toggleFilter( 'goldstar' )
SO333
Posts: 11
Joined: Thu Apr 03, 2008 11:40 am

Re: toggle ? Javascript Checkbox issue

Post by SO333 » Thu Oct 09, 2008 7:57 pm

Does not work for me :-(
feten
Posts: 1
Joined: Fri Dec 05, 2008 1:09 pm

Re: toggle ? Javascript Checkbox issue

Post by feten » Wed Dec 31, 2008 9:02 am

u can use CLICK
It simulate the click of mouse.
CLICK X=x Y=y
To know the position of checkBox u must change a click mode to X/Y position and record action of check.
User avatar
Tech Support
Posts: 4947
Joined: Tue Sep 20, 2005 7:25 pm
Contact:

Re: toggle ? Javascript Checkbox issue

Post by Tech Support » Fri Jan 02, 2009 3:02 pm

feten is correct, this macro works with the test URL:

Code: Select all

URL GOTO=http://js-tut.aardon.de/js-tut/tutorial/excheck.html
CLICK X=19 Y=78
CLICK X=19 Y=99
SO333
Posts: 11
Joined: Thu Apr 03, 2008 11:40 am

Re: toggle ? Javascript Checkbox issue

Post by SO333 » Thu Jan 08, 2009 9:24 am

Maybe I should have been more precisely: For my problem (automatically downloading my newspaper every morning), this solution does not work as the position of the checkbox changes (depending on the number of ressorts the newspaper is covering that day).
additional001
Posts: 175
Joined: Sun Jul 06, 2008 3:24 am

Re: toggle ? Javascript Checkbox issue

Post by additional001 » Fri Jan 09, 2009 1:35 am

I gave up on this issue... lol I haven't tested for it in so long. I'm sure it still exsists. I wanted to comment on the suggestion of using X Y cordinates for a soloution. This is at best a LAST option. Click commands are not portable(meaning if you want to share this script you can hang it up). This is a very lazy "fix" to a rather long standing BUG
sfchris
Posts: 5
Joined: Thu Mar 19, 2009 4:59 pm

Re: toggle ? Javascript Checkbox issue

Post by sfchris » Thu Mar 19, 2009 7:02 pm

Tech Support wrote:feten is correct, this macro works with the test URL:

Code: Select all

URL GOTO=http://js-tut.aardon.de/js-tut/tutorial/excheck.html
CLICK X=19 Y=78
CLICK X=19 Y=99
Hi Tech Support, I just wanted to let you know that this bug still exists in the latest version of iMacros.

Your X/Y coordinates above work for this particular web page, although when I record my own macros I get different X/Y coordinates for this page (and in fact, one click registers as two separate clicks in the code). So I think the bug now may be that X/Y coordinates have to be precise and the recorder is not giving accurate positions. And by adding two clicks for each one click you may actually be checking and then unchecking the boxes in some cases! (not in mine)

Also, I think that some web pages may adjust the layout slightly between loads, because as other users have reported I have found web pages where no values for CLICK check the check box at all.

I hope you can fix this because the project I downloaded your addin for will not work without javascript checkboxes working.

One thing you could do that would be helpful is to display with a dot, the location that CLICK has clicked. That way, if the values the recorder gave are wrong, we can manually adjust them by trial and error until they hit the box.
Post Reply