[jQuery] Problem with submit button of an inserted form

[jQuery] Problem with submit button of an inserted form


I have the following code:
$(placeInDOM).replaceWith(header + fields + footer);
$(placeInDOM).find(':submit').click(function() {
alert("clicked the submit button");
return false;
});
The first statement places a form with a submit button in my page.
This works as it should.
With the second I want to give an alert instead of a submit when
clicking on the submit button. But it does not work.
When I after the first statement execute:
alert($(placeInDOM).find(':submit').html());
I get
null
If I execute:
alert($(placeInDOM).find(':submit'));
I get:
[object Object]
What am I doing wrong?
I found a workaround by using:
$('.submit').click(function() {
But this only works when my form is the only form on the page. So it
is not very satisfactory.
--
Cecil Westerhof