haha, i totally didn't realize the faq mentioned the plugin. i should goto sleep...
seedy wrote: > > I should have mentioned there is a plugin that will help with also called > livequery > http://brandonaaron.net/docs/livequery/ > > > robing-2 wrote: >> >> >> Thanks for that link seedy, I have managed to get the new buttons >> working by adding the click events back on the elements after the dom >> changes. >> I added the the click function to a variable to another function which >> i call after i change the dom. >> >> >> $('#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 >> now rebind the click events by calling the >> function >> bindCreateBehaviors(); >> } >> ); >> }) >> >> var bindCreateBehaviors = function() { >> $('#panal_update).click(function(){ rest of function behaviour >> >> }) >> >> >> thanks again. >> >> >> On Oct 11, 10:24 am, seedy <[EMAIL PROTECTED]> wrote: >>> http://docs.jquery.com/Frequently_Asked_Questions#Why_do_my_events_st... >>> >>> >>> >>> >>> >>> 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-tf460... >>> Sent from the jQuery General Discussion mailing list archive at >>> Nabble.com.- Hide quoted text - >>> >>> - Show quoted text - >> >> >> > > -- View this message in context: http://www.nabble.com/submit-buttons-added-to-form-don%27t-work-tf4603575s27240.html#a13148171 Sent from the jQuery General Discussion mailing list archive at Nabble.com.

