By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,010 Members | 2,774 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,010 IT Pros & Developers. It's quick & easy.

accessing select onchange() event from image map

P: 2
Hi everyone.

I have this bizarre problem and i am hoping someone can point me in the right direction.

I have a group of form selects, and when one is changed it dynamically changes the content of the next. fairly bog standard. no problems there.

I also have an image map. You click on part of the image and it calls a javascript function which then sets the select index and triggers the onchange() event.

The href:
href="javascript:getmap_func(\'1\')"

which calls:

function getmap_func ( selectedarea ) {
document.myForm.elements[0].selectedIndex = selectedarea ;
document.myForm.elements[0].onchange();
}

The whacko thing about this is that it works perfectly fine, but only after the page has been refreshed. when it first loads it doesnt work. the select and its onchange() work fine, but not by accessing it through the imagemap, when i reload the page it runs fine and doesnt miss a beat.

???

any ideas.

Huge appreciation in advance, i have spent 2 days googling trying to find a solution.

cheers.
Nov 6 '06 #1
Share this Question
Share on Google+
2 Replies


P: 2
Hi everyone.

I am going to repeat myself, as this is urgent, and i require a solution.

I have this bizarre problem and i am hoping someone can point me in the right direction.

I have a group of form selects, and when one is changed it dynamically changes the content of the next. fairly bog standard. no problems there.

I also have an image map. You click on part of the image and it calls a javascript function which then sets the select index and triggers the onchange() event.

The href:
href="javascript:getmap_func(\'1\')"

which calls:

function getmap_func ( selectedarea ) {
document.myForm.elements[0].selectedIndex = selectedarea ;
document.myForm.elements[0].onchange();
}

The whacko thing about this is that it works perfectly fine, but only after the page has been refreshed. when it first loads it doesnt work. the select and its onchange() work fine, but not by accessing it through the imagemap, when i reload the page it runs fine and doesnt miss a beat.

???

any ideas.

Huge appreciation in advance, i have spent 2 days googling trying to find a solution.

cheers.
Nov 6 '06 #2

100+
P: 141
hi,

Can u send ur code then i will try that code

is that onchange() event is not called after selecting a image part




Hi everyone.

I am going to repeat myself, as this is urgent, and i require a solution.

I have this bizarre problem and i am hoping someone can point me in the right direction.

I have a group of form selects, and when one is changed it dynamically changes the content of the next. fairly bog standard. no problems there.

I also have an image map. You click on part of the image and it calls a javascript function which then sets the select index and triggers the onchange() event.

The href:
href="javascript:getmap_func(\'1\')"

which calls:

function getmap_func ( selectedarea ) {
document.myForm.elements[0].selectedIndex = selectedarea ;
document.myForm.elements[0].onchange();
}

The whacko thing about this is that it works perfectly fine, but only after the page has been refreshed. when it first loads it doesnt work. the select and its onchange() work fine, but not by accessing it through the imagemap, when i reload the page it runs fine and doesnt miss a beat.

???

any ideas.

Huge appreciation in advance, i have spent 2 days googling trying to find a solution.

cheers.
Nov 7 '06 #3

Post your reply

Sign in to post your reply or Sign up for a free account.