Friday, January 30, 2009

[jQuery] Jquery remove dd problem

Hi,

I'm currently using the plugin jQueryForm.

With it I want to retrieve some info from the Ajax request. In order to do
that, each time the user submit the form, I need to clean the information
retrieved previously.

In my XHTML code I have some div in charge of those messages, which is this:

<div id="ok" style="display:none;">
<h1>Sucesso!</h1>
<dl id="list_sucesso">
<dt>As seguintes operações foram realizadas:</dt>
</dl>
</div>

In the JS part, I did set this:

$(document).ready(function() {

$("#form").ajaxForm(function(data){

$("#list_sucesso dt dd").remove();
$("#ok").fadeIn();
$("#list_sucesso dt").after("<dd>"+ data + "</dd>");

});

});

The problem is that the line $("#list_sucesso dt dd").remove(); isn't
removing the dd tags. I tried to use empty() as well, and still didn't work.
Tried with html(""), and didn't happen as expected. It's always just adding
a DD tag after the one that was created on the previously submission.

Any ideas?

I appreciate any advice.

Nicholas
--
View this message in context: http://www.nabble.com/Jquery-remove-dd-problem-tp21747270s27240p21747270.html
Sent from the jQuery General Discussion mailing list archive at Nabble.com.

No comments: