[jquery-ui] [UI Dialog] Passing data to the dialog when opening

2010-03-02 Thread debussy007
Hi, I have multiple places on my page where the user may click and it will open a dialog. In the dialog I need to know somehow where the user clicked exactly ... $('div.quarter').click(function() { var data = $(this)... $('#dialogForm').dialog('open'); /* pass the data to

[jquery-ui] [UI Dialog] Passing data to the dialog when opening

2010-03-02 Thread debussy007
Hi, I have multiple places on my page where the user may click and it will open a dialog. In the dialog I need to know somehow where the user clicked exactly ... $('div.quarter').click(function() { var data = $(this)... $('#dialogForm').dialog('open'); /* pass the

[jquery-ui] get the previous element matching a class

2010-03-02 Thread debussy007
Hi, I would like to have the previous TD element with class time. I tried : $(this).closest('td').prev('td.time').html() (where this is a div element inside a TD) But it only works for a div inside a TD that is *directly* following the td.time element. See the code below: my jquery selector

Re: [jquery-ui] get the previous element matching a class

2010-03-02 Thread Thomas Thomas
Sorry, I moved this post to the jQuery General Discussion group. 2010/3/2 debussy007 debussy...@gmail.com Hi, I would like to have the previous TD element with class time. I tried : $(this).closest('td').prev('td.time').html() (where this is a div element inside a TD) But it only works

[jquery-ui] Populate a modal?

2010-03-02 Thread Clayton Dukes
How can I populate a modal field with a variable? e.g: When the user clicks, the modal opens and a field is already poputaled by something like this: var url = $(#q_hist).val() -- __ Clayton Dukes

[jquery-ui] Re: Populate a modal?

2010-03-02 Thread Roman
There are at least a couple of ways to do this. One is to populate the field before you call the dialog() method to open the dialog. Another is to do that in a function you associate with the open event. See Events tab on http://jqueryui.com/demos/dialog/. -- You received this message because

Re: [jquery-ui] Re: Populate a modal?

2010-03-02 Thread Clayton Dukes
Sorry, I'm not getting it - I tried this: open: function() { $(#save_hist_dialog input[id='url']).val(url); }, But it's not working... The full js is here: http://pastebin.com/e8YBb6B9 On Tue, Mar 2, 2010 at 5:19 PM, Roman roman...@gmail.com

[jquery-ui] Re: Populate a modal?

2010-03-02 Thread Roman
First of all, it seems that you'd get a syntax error because you don't a semicolon after var url = $(#q_hist).val() Secondly, does $(#save_hist_dialog input[id='url']).val(url) do its job by itself (to be sure you have the correct selector)? -- You received this message because you are

Re: [jquery-ui] Re: Populate a modal?

2010-03-02 Thread Clayton Dukes
I got it...(yay!) You're question clued me in - I had copied that from somewhere else and thought that it would find the dialog window and populate the id of url with my data. In fact, all I needed was: $(#url).val(url); Thanks!!! On Tue, Mar 2, 2010 at 6:04 PM, Roman roman...@gmail.com wrote: