Closed Bug 175997 Opened 22 years ago Closed 22 years ago

onchange doesn't excute the intended JS

Categories

(Core :: DOM: Events, defect)

x86
Windows ME
defect
Not set
minor

Tracking

()

VERIFIED INVALID

People

(Reporter: khalid_kary, Assigned: joki)

References

()

Details

User-Agent:       Mozilla/5.0 (Windows; U; Win 9x 4.90; en-US; rv:1.2b) Gecko/20021016
Build Identifier: Mozilla/5.0 (Windows; U; Win 9x 4.90; en-US; rv:1.2b) Gecko/20021016

http://creaturesx.ma.cx/browse.php, in this page there's a <select> from which
you can choose the page you want to go to, this is done by using the onchange
attribute
<select onchange="jsfunction()">
it doesn't work although it works on IE, it facilitates the usage however.
because i don't have to add "GO" button beside it it automatically goes.

Reproducible: Always

Steps to Reproduce:
1.just go to the page
2.then tyr to choose a page
3.and it won't work 

Actual Results:  
when you select the intended page the browser doesn't react

Expected Results:  
the browser should take you to the intended page

sorry if this is a nearly a feature, but i saw a lot of websites that use this
thing and it's extra important, i submitted because i'm not sure if it is a bug
or a feature request, however thanx for help
You have alot of invalid code on your page which is causing the problem. You're
referencing form elements by their ID's only (e.g. myform.page.value), when you
should be using document.forms['myform'].page or
document.getElementById(elementId)
<http://www.mozilla.org/docs/dom/domref/dom_doc_ref.html#1022427>.

You're also using "\" characters in your <img> tags, when you should be using
the conventional "/" for loading media on the internet.  This is not a problem
is Mozilla. Go to <http://www.webreference.com/programming/javascript/> and
observe that their "Browse >" <select> (in the page footer) which uses the
onclick handler functions correctly.
> myform.page.value=mypage.value

"myform" is not defined, so this code cannot work.  Use document.myform and
things will be happy

> because i don't have to add "GO" button beside it

Except for people who have JS disabled because of security concerns...
Status: UNCONFIRMED → RESOLVED
Closed: 22 years ago
Resolution: --- → INVALID
Khalid, 

It would make a lot of sense if you used Javascript Console (Tools -> Web
Development -> Javascript Console). Make using it a habit; that will make you
see the sources of problems right away. For example, open that console and load
your page in Mozilla.

v.
Status: RESOLVED → VERIFIED
Actually, the JS console showed no error here.... we have some issues with some
errors in event handlers.  :(
You need to log in before you can comment on or make changes to this bug.