http://docs.jquery.com/Frequently_Asked_Questions#Why_do_my_events_stop_working_after_an_Ajax_request.3F
robing-2 wrote:
>
>
> Hello Group,
>
> This is my first post to the group and I am pretty new to the jquery
> and I have just come up against a slight problem that I can't resolve
> so any help would be greatly appreciated.
>
>
> I have a small form that when the submit button is clicked gets the
> form input saved to a database via xmlhttprequest, when i get the
> call back from the server i then inject new buttons to the bottom of
> the form so the previous settings can be updated, however my problem
> is that even though I can see and click on the newly added buttons
> when i click on them nothing happens at all not even a click event.
> What am i doing wrong?
>
>
> $('#panal_add').click(function(){
> $("form").bind("submit", function() { return false; })
> //get the form data to be passed to the php file
> $.get("update.php",
> {form varables},
> function(data)
> {
> //inject different form submit buttons in to
> the div element
> var buttons =
> document.getElementById("buttons_div");
> buttons.innerHTML = "
> <input type='submit' name='panal_update'
> value='Update Details'
> id='panal_update' class='bttn' />
> <input type='submit' name='details_delete'
> value='Delete Panal'
> id='panal_delete' class='bttn' />
> </form>";
>
> }
> );
> })
>
> $('#panal_update').click(function(){
> alert("hello");
> })
>
>
>
--
View this message in context:
http://www.nabble.com/submit-buttons-added-to-form-don%27t-work-tf4603575s27240.html#a13145141
Sent from the jQuery General Discussion mailing list archive at Nabble.com.