Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I need help, I have a website developed using Argis Server 9.3 and Visual Studio 2008. The map is inside the website via an iframe and it receives the input to be used in a custom query via javascript, this is working fine, except that, the users still have to clic the button of the QueryAttributesTask component to execute the query task. Does anyone knows how can I call the button clic code from another button (like an asp button)?

Any ideas on how to accomplish this?

share|improve this question

1 Answer 1

up vote 0 down vote accepted

You might be able to use the contentWindow property to access the execute query button in the iframe and simulate a click using the .click() method.

var childWindow =  document.getElementById("iframeMap").contentWindow; 
childWindow.document.getElementById("btnExecQuery").click(); 

Keep in mind your iframe must be on the same domain for the browser to allow scripting between the parent and child windows. See Same Origin Policy. Also, this approach is not cross-browser, so this may not work depending on your environment.

share|improve this answer
    
I'll try this. Thanks. –  eiefai Dec 15 '10 at 16:53

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.