Cecil Westerhof ha scritto:
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
This is right, cause a subimit button doesn't have html in it...
If I execute:
        alert($(placeInDOM).find(':submit'));
I get:
    [object Object]

What am I doing wrong?
Try using console.log of firebug to see if the returned object contains what you're expecting.

A question, what placeInDOM contains? is an id? the html you're replacing contains the id?

Bye

--
gianiaz.net - web solutions
via piedo, 58 - 23020 tresivio (so) - italy
+39 347 7196482

Reply via email to