[jQuery] Ajax only works once

2006-09-04 Thread ivan quintero
I have form elements that update an HTML table within a DIV. It's an invoices application and the each detail element (invoice items) on the invoice has a input button with that when clicked on it deletes that item.
The problem is that it works only once. I click on the button, the item is deleted, the div is updated with the new HTML. But afterwards all of the input buttons that delete the items stop working. I click on them and nothing happens. I have to refresh the web page to get that functionality again.
Why this behaviour?--  Ivan Quintero
___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] Ajax only works once

2006-09-04 Thread David Duymelinck
ivan quintero schreef:
 I have form elements that update an HTML table within a DIV. It's an 
 invoices application and the each detail element (invoice items) on 
 the invoice has a input button with that when clicked on it deletes 
 that item.

 The problem is that it works only once. I click on the button, the 
 item is deleted, the div is updated with the new HTML. But afterwards 
 all of the input buttons that delete the items stop working. I click 
 on them and nothing happens. I have to refresh the web page to get 
 that functionality again.

 Why this behaviour?

The ready function can't read the new formed html because the page 
doesn't reload. You can find more on this in the archives.

The best way, i understood,  is to put all the events and behaviour you 
need in a function outside of the ready function and call that function 
in the ready function and in the callback of the ajax function. I assume 
you use ajax to generate your new html.

-- 
David Duymelinck

[EMAIL PROTECTED]


___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/