[jQuery] New to jQuery, question on accessing form elements in nested HTML documents
I have a form that lives in its own HTML file. If I load the jQuery
library into the page, I can assign click handlers to buttons on the
form, no problem, by putting them in the $(document).ready function
like this:
$(document).ready(function(){
alert('document is ready'); // just seeing if we're awake
$('#btnsubmit').click(function() {
alert('submit was clicked'); // we ought to see this every time
return false;
});
});
That page works fine standalone in a browser... However, if I load
that HTML file into an ThickBox on another page, the click handlers no
longer work. I see the alert message telling me that $(document).ready
is called, but the code inside the click handler is not executed.
Would I have to define the handlers in the outer HTML document for
this to work?
TIA,
Jim