Onchange events not triggered

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
michelek
Posts: 2
Joined: Wed Feb 27, 2008 5:05 pm

Onchange events not triggered

Post by michelek » Wed Feb 27, 2008 5:26 pm

Onchange events does not seem to be triggered by iMacros for Firefox when selecting the first entry of a dropdown listbox. Try for example the macro:

Code: Select all

ONDIALOG POS=1 BUTTON=OK CONTENT=
TAG POS=1 TYPE=SELECT FORM=NAME:NoFormName ATTR=ID:cfgAlarmType CONTENT=$0
TAG POS=1 TYPE=SELECT FORM=NAME:NoFormName ATTR=ID:cfgAlarmType CONTENT=$1
on the following html select tag:

Code: Select all

<select name="cfgAlarmType" id="cfgAlarmType" onchange="alert(this.value);">
	<option value="0" >Rising
	<option value="1" selected>Falling
</select>
Is this a bug?
User avatar
Tech Support
Posts: 4947
Joined: Tue Sep 20, 2005 7:25 pm
Contact:

Post by Tech Support » Thu Feb 28, 2008 1:49 pm

Do you have a test website for us?

This macro works:

Code: Select all

URL GOTO=http://www.w3schools.com/jsref/jsref_onchange.asp
TAG POS=1 TYPE=INPUT:TEXT FORM=NAME:NoFormName ATTR=ID:fname CONTENT=small
TAG POS=1 TYPE=H2 ATTR=TXT:Try-It-Yourself<SP>Demos
michelek
Posts: 2
Joined: Wed Feb 27, 2008 5:05 pm

Post by michelek » Thu Feb 28, 2008 7:09 pm

Unfortunately no, I found this issue on an internal application. But you can try copying my example on an empty html page.

From what I've seen iMacros seems to assume that the selected value is always the first one, regardless of the initial or the current selection. So the onchange event is never triggered when selecting the first entry of the list.
myplacedk
Posts: 7
Joined: Tue Mar 04, 2008 8:44 am

Post by myplacedk » Tue Mar 04, 2008 10:13 am

I can confirm this bug, using 6.0.3.0.
Tech Support wrote:Do you have a test website for us?

This macro works:

Code: Select all

URL GOTO=http://www.w3schools.com/jsref/jsref_onchange.asp
TAG POS=1 TYPE=INPUT:TEXT FORM=NAME:NoFormName ATTR=ID:fname CONTENT=small
TAG POS=1 TYPE=H2 ATTR=TXT:Try-It-Yourself<SP>Demos
That code is not about select-tabs, so it is irrelevant. If it helps, I can create a public HTML-page to demonstrate the bug.
myplacedk
Posts: 7
Joined: Tue Mar 04, 2008 8:44 am

Post by myplacedk » Tue Mar 04, 2008 12:06 pm

I tried creating a simple page to re-create the problem. But I get the same problem on every option now, not just the first. Maybe I've overlooked something. But it still looks like a bug. :)

Code: Select all

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
   "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head><title></title></head>
<body>
<form name="testform" action="">
	<select name="test" id="test" onchange="alert(this.value);">
		<option value="0">Zero</option>
		<option value="1" selected="selected">One</option>
		<option value="2">Two</option>
	</select>
</form>
</body>
</html>
These lines SHOULD create Javascript alerts, but none of them does:

Code: Select all

TAG POS=1 TYPE=SELECT FORM=NAME:testform ATTR=NAME:test CONTENT=$2
TAG POS=1 TYPE=SELECT FORM=NAME:testform ATTR=NAME:test CONTENT=$0
User avatar
Tech Support
Posts: 4947
Joined: Tue Sep 20, 2005 7:25 pm
Contact:

Post by Tech Support » Mon Mar 10, 2008 4:06 pm

Update: We are still working on this issue.
snozzle
Posts: 2
Joined: Mon May 05, 2008 2:30 pm

Re: Onchange events not triggered

Post by snozzle » Mon May 05, 2008 2:38 pm

Is there a work around for this issue or a link to a help page? Thanks!
snozzle
Posts: 2
Joined: Mon May 05, 2008 2:30 pm

Re: Onchange events not triggered

Post by snozzle » Mon May 05, 2008 3:07 pm

Use DirectScreen

didn't work
starrychloe
Posts: 3
Joined: Wed Feb 06, 2008 4:09 pm

Re: Onchange events not triggered

Post by starrychloe » Fri May 16, 2008 5:03 pm

I second this bug. That would explain my problem, because it just so happens that the value I'm changing to that is not triggering the Javascript is the first item in the list, even though the 2nd item was selected when first loaded.
gimber_sj
Posts: 7
Joined: Fri Jun 06, 2008 9:10 am
Location: Bristol

Re: Onchange events not triggered

Post by gimber_sj » Mon Jun 09, 2008 4:16 pm

Yup, I've just noticed this too (v6.14, build 105, IE 6.0.2900).
The screen works fine in IE natively, works fine in FF when automated, but doesn't work with the standard iMacros browser - even when emulating IE.

This is a good problem...
User avatar
Tech Support
Posts: 4947
Joined: Tue Sep 20, 2005 7:25 pm
Contact:

Re: Onchange events not triggered

Post by Tech Support » Fri Jun 13, 2008 1:17 pm

Currently we are unable to recreate this issue.

If you have a public website where you see such an issue please post it here and mention whether this is an issue in the iMacros Browser/iMacros for Internet Explorer (both have the same code base) and/or iMacros for Firefox.

You can also attach screenshots to your post.

Thanks!
Anurag
Posts: 2
Joined: Mon Jun 30, 2008 11:33 pm

Re: Onchange events not triggered

Post by Anurag » Mon Jun 30, 2008 11:48 pm

I have the same problem and with all the options.

I tested a demo on imacros and it was working.(http://www.iopus.com/imacros/demo/v5/f1/form.asp) The difference is on the demo, the options are straight without values like

<select name="drink" size="1">
<option selected="selected">--- Please select ---</option>
<option>Water</option>
<option>Milk</option>
<option>Coke</option>
<option>7up</option>
</select>

In the problem case, the options have values like:

<select id="p26" name="p26">
<option selected="selected" value="abcd:AB CD">"AB CD" abcd</option>
<option value="efgh:EF GH">"EF GH" efgh</option>
</select>

Unfortunately the site is not public so cant give you a test case or screenshots. I am testing on Firefox.

Thanks
Anurag
Posts: 2
Joined: Mon Jun 30, 2008 11:33 pm

Re: Onchange events not triggered

Post by Anurag » Wed Jul 02, 2008 11:00 pm

Well I was able to get a workaround

Here is what I used:

TAG POS=1 TYPE=SELECT FORM=NAME:editPage ATTR=ID:p26 CONTENT=$*apple*

The * is the key.
gimber_sj
Posts: 7
Joined: Fri Jun 06, 2008 9:10 am
Location: Bristol

Re: Onchange events not triggered

Post by gimber_sj » Thu Jul 10, 2008 7:54 am

This onchange issue seems to occur (for me) with asp.net postback changes - standard lists and changes work fine, it's just the postback ones that cause the problems.

Hope that helps to narrow it down somewhat.
bbenson
Posts: 2
Joined: Tue May 19, 2015 9:00 pm

Re: Onchange events not triggered

Post by bbenson » Tue May 19, 2015 9:05 pm

I am running into this issue with IMacros Scripting Addition 7.36

TAG POS=1 TYPE=SELECT FORM=NAME:frmUsers ATTR=NAME:lbxUsers CONTENT=$"{{NAME}}"

TAG command is highlighting the correct item in the listbox but it is not triggering the onchange event.

Is there a workaround for this issue?

also wanted to add that I tried adding * and it did not work for me...
Post Reply