RE: [jQuery] Complicated Question - Solved

2010-01-16 Thread Dave Maharaj :: WidePixels.com
that looks wrong or could use improvement please let me know. Thanks again for all your time Dave -Original Message- From: Jack Killpatrick [mailto:j...@ihwy.com] Sent: January-16-10 7:51 PM To: jquery-en@googlegroups.com Subject: Re: [jQuery] Complicated Question If you're r

RE: [jQuery] Complicated Question

2010-01-16 Thread Dave Maharaj :: WidePixels.com
But the only alert is the selector. alert(form_url + form_target + update_target); never fires off. I think im getting there but still this is all new to me so it more trial and error than anything. Thanks, Dave -Original Message- From: Jack Killpatrick [mailto:j...@ihwy.com] Se

Re: [jQuery] Complicated Question

2010-01-16 Thread Jack Killpatrick
If you're rendering the button on-the-fly (as part of your form) be sure to either a) hook up that button click handler after the button is rendered or b) use the event delegation approach I showed in my example. It sounds like your click is not firing now, probably because the click isn't actu

RE: [jQuery] Complicated Question

2010-01-16 Thread Dave Maharaj :: WidePixels.com
Ok im getting closer. This gives me the id for each form being submitted, the alert(selector); in the external js fires off so its getting the request, but the form now does not submit...just stis there laughing at me. Page js: //dummy class added to button to test it out $(".dummy").click(fun

RE: [jQuery] Complicated Question

2010-01-16 Thread Dave Maharaj :: WidePixels.com
I have completely removed the uRec function for now and changed to a regular button, no submit. $("button").click(function () { var form_id = '#123123123'; //var form_id = $this.closest('form'); // get the recordId alert(form_id); //uRec(form_id); r

Re: [jQuery] Complicated Question

2010-01-16 Thread Jack Killpatrick
If uRec is still like it was before: function uRec(selector){ var $form = $(selector); in the example below you're passing it an id, so try: var $form = $('#' + selector); I was suggesting changing the button type from submit to button, yes. It's no big deal, but at least it will preven

RE: [jQuery] Complicated Question

2010-01-16 Thread Dave Maharaj :: WidePixels.com
I have changed my page js to: $("form").bind("submit", function() { var form_id = $(this).attr('id'); alert(form_id); uRec(form_id); return false; }) The alert shows the form id for the form i am attempting to submit and it changes each time I click sumbit

Re: [jQuery] Complicated Question

2010-01-16 Thread Jack Killpatrick
This may or may not help you, but often in situations like this what I do is use .closest() to get the id that I need for the edited record, like this: your form gets injected here your form gets injected here assuming each form has it's own submit button, you could use event delegati

[jQuery] Complicated Question

2010-01-16 Thread Dave Maharaj :: WidePixels.com
I have sets of records on a page each has an edit link, clicking the link loads an edit form into the record the user wants to edit, so a user can click edit beside every link creating an unknown number of forms on the page. user records "edit" user records "edit" user records "edit"