~J~ wrote:
Hi everyone,
I'm positive this is possible, just never needed it until now and I don't have a clue where to start.
I have an XML document that is attached to an XSL style sheet, within this XSL there is some javascript commands that are attached to certain HTML controls.
What I want to do is when the user clicks on an HTML generated code (because I can't generate server-side controls in XSL), this runs a subroutine which is server-side.
How can I force a control to run something server-side, and can I pass parameters to it?
Many thanks,
One idea is to do a submit for the form from the javascript code
(document.forms[0].submit() will do the trick). You will have to call
your method from the page load event if you decide that the javascript
on the client did the post back. You can use a html hidden control to
pass parameters.
Another idea is to use a very small image submit control (1x1 pixels)
with a transparent color and from the script to enforce a click on this
submit button (theSubmit.click() will do the trick - be aware of the
browser compatibilities here). Has the advantage that it will run the
server side control onclick event but the disadvantage of a "hack".