[jQuery] Draggable to Grid Help?

2008-12-17 Thread ryanhavoc

Hi,

I have a series of draggable elements within a containing element. I
want the to drag on a grid but I want them all to snap to the same
grid no all have their own individual snappings.

Does anyone know how I can do this?

Thanks


[jQuery] Struggling with Callbacks

2008-11-03 Thread ryanhavoc

Hi,

Hope someone can help. I'm struggling with getting my syntax right for
a call back.

What's i've done is wrap my setting for the jQuery dialog plugin in a
function so I can use the same setting over and over. So that's looks
like this:

function opendays_dialog(trigger){
//Get href from link
var url = $(trigger).attr(href);

//Ajax get from href link
$.get(url, function(data){
//Display content in dialog box
$(data).dialog({
height: auto,
width: auto,
resizable: false,
draggable: false,
position: center,
modal: true,
overlay: {
background: #33
},
close: function(ev, ui) { 
$(this).dialog(destroy).remove(); }
});

$(div.ui-dialog-content).css({height: auto});
});
}

And I'm calling it in another function like so:
function opendays_manageCoursesDialog(){

$(a.manage_courses).click(function() {

//Load dialog box
opendays_dialog($(this));

opendays_manageCourses_add();
opendays_manageCourses_prepare();

The dialog loads, however the two additional functions you can see
above don't run. I was thinking they will needing to be passed as a
callback something like:

opendays_dialog($(this), function(){
opendays_manageCourses_add();
opendays_manageCourses_prepare();
});

But I'm not sure about the correct syntax to make it work.

Can anyone help?

Thanks


[jQuery] Re: [validate] Problem with validation on a form pulling in with Ajax

2008-10-29 Thread ryanhavoc

Yes, $(#attendee_editForm) is the id of the form being pulling in.

It's difficult to create a test page as it's linked to confidential
data at the minute.

On Oct 28, 11:01 pm, Jörn Zaefferer [EMAIL PROTECTED]
wrote:
 Does $(#attendee_editForm) match any elements? A testpage would help.

 Jörn

 On Tue, Oct 28, 2008 at 5:38 PM, ryanhavoc [EMAIL PROTECTED] wrote:

  I have a script that generates a form. I'm pulling this form into a
  dialog box on my main index page via Ajax and trying to attached the
  Validate plugin to the form.

  So I've got this:

  $(a.attendee_add).click(function() {
         //Get href from link
         var addURL = $(this).attr(href);

         //Ajax get from href link
         $.get(addURL, function(data){
                 //Display content in dialog box
                 $(data).dialog({
                         height: auto,
                         width: auto,
                         resizable: false,
                         draggable: false,
                         position: center,
                         modal: true,
                         overlay: {
                                 background: #33
                         },
                         close: function(ev, ui) { 
  $(this).dialog(destroy).remove(); }
                 });

                 //Attach validate plugin
                 $(#attendee_editForm).validate();
       });
       return false;
  });

  However it doesn't work.

  If I don't pull the form in with ajax and instead just paste it into
  my index page and add in $(#attendee_editForm).validate(); to the
  document ready function it works so I know my form is marked up
  properly.

  Has anyone any idea how I can get this working?

  Thanks


[jQuery] Re: [validate] Problem with validation on a form pulling in with Ajax

2008-10-29 Thread ryanhavoc

OK, I've created a test page getting rid off all the over javascript
i'm using.

http://common.leeds-art.ac.uk/validate/openday_bookings/test.php

Same problem.

I've got a link at the top that loads the form in a dialog box from a
seperate file, test_add_attendee.php

And I've also put that same form on the test.php page. The form on the
page runs the validate however the form i the dialog does not.

Any ideas?

Thanks

On Oct 29, 9:22 am, Jörn Zaefferer [EMAIL PROTECTED]
wrote:
 Yes, thats why its called a testpage. You need to strip anything
 unrelated so that we can focus on the actual problem.

 Jörn

 On Wed, Oct 29, 2008 at 10:16 AM, ryanhavoc

 [EMAIL PROTECTED] wrote:

  Yes, $(#attendee_editForm) is the id of the form being pulling in.

  It's difficult to create a test page as it's linked to confidential
  data at the minute.

  On Oct 28, 11:01 pm, Jörn Zaefferer [EMAIL PROTECTED]
  wrote:
  Does $(#attendee_editForm) match any elements? A testpage would help.

  Jörn

  On Tue, Oct 28, 2008 at 5:38 PM, ryanhavoc [EMAIL PROTECTED] wrote:

   I have a script that generates a form. I'm pulling this form into a
   dialog box on my main index page via Ajax and trying to attached the
   Validate plugin to the form.

   So I've got this:

   $(a.attendee_add).click(function() {
          //Get href from link
          var addURL = $(this).attr(href);

          //Ajax get from href link
          $.get(addURL, function(data){
                  //Display content in dialog box
                  $(data).dialog({
                          height: auto,
                          width: auto,
                          resizable: false,
                          draggable: false,
                          position: center,
                          modal: true,
                          overlay: {
                                  background: #33
                          },
                          close: function(ev, ui) { 
   $(this).dialog(destroy).remove(); }
                  });

                  //Attach validate plugin
                  $(#attendee_editForm).validate();
        });
        return false;
   });

   However it doesn't work.

   If I don't pull the form in with ajax and instead just paste it into
   my index page and add in $(#attendee_editForm).validate(); to the
   document ready function it works so I know my form is marked up
   properly.

   Has anyone any idea how I can get this working?

   Thanks


[jQuery] Re: [validate] Problem with validation on a form pulling in with Ajax

2008-10-29 Thread ryanhavoc

Okay, I've replaced the minified files with uncompressed. Refresh.

Thanks

Ryan

On Oct 29, 10:08 am, Jörn Zaefferer [EMAIL PROTECTED]
wrote:
 Okay, that helps. So far I couldn't find anything obvious though,
 really weird issue. Please replace the minified files with normal
 source files, but makes debugging possible.

 Jörn

 On Wed, Oct 29, 2008 at 10:59 AM, ryanhavoc

 [EMAIL PROTECTED] wrote:

  OK, I've created a test page getting rid off all the over javascript
  i'm using.

 http://common.leeds-art.ac.uk/validate/openday_bookings/test.php

  Same problem.

  I've got a link at the top that loads the form in a dialog box from a
  seperate file, test_add_attendee.php

  And I've also put that same form on the test.php page. The form on the
  page runs the validate however the form i the dialog does not.

  Any ideas?

  Thanks

  On Oct 29, 9:22 am, Jörn Zaefferer [EMAIL PROTECTED]
  wrote:
  Yes, thats why its called a testpage. You need to strip anything
  unrelated so that we can focus on the actual problem.

  Jörn

  On Wed, Oct 29, 2008 at 10:16 AM, ryanhavoc

  [EMAIL PROTECTED] wrote:

   Yes, $(#attendee_editForm) is the id of the form being pulling in.

   It's difficult to create a test page as it's linked to confidential
   data at the minute.

   On Oct 28, 11:01 pm, Jörn Zaefferer [EMAIL PROTECTED]
   wrote:
   Does $(#attendee_editForm) match any elements? A testpage would help.

   Jörn

   On Tue, Oct 28, 2008 at 5:38 PM, ryanhavoc [EMAIL PROTECTED] wrote:

I have a script that generates a form. I'm pulling this form into a
dialog box on my main index page via Ajax and trying to attached the
Validate plugin to the form.

So I've got this:

$(a.attendee_add).click(function() {
       //Get href from link
       var addURL = $(this).attr(href);

       //Ajax get from href link
       $.get(addURL, function(data){
               //Display content in dialog box
               $(data).dialog({
                       height: auto,
                       width: auto,
                       resizable: false,
                       draggable: false,
                       position: center,
                       modal: true,
                       overlay: {
                               background: #33
                       },
                       close: function(ev, ui) { 
$(this).dialog(destroy).remove(); }
               });

               //Attach validate plugin
               $(#attendee_editForm).validate();
     });
     return false;
});

However it doesn't work.

If I don't pull the form in with ajax and instead just paste it into
my index page and add in $(#attendee_editForm).validate(); to the
document ready function it works so I know my form is marked up
properly.

Has anyone any idea how I can get this working?

Thanks


[jQuery] Dialog box that auto expands depending on content

2008-10-29 Thread ryanhavoc

I have a form that I pull into a dialog box. I've set the dialog to
have an auto height as an option and it sets the height when the
form is pulled in.

However I'm also using the validate plugin which when displaying an
error message adds additional height the the form. However the dialog
doesn't expand with this additional content.

Does anyone know how I can make it do this?

You can see a test of the dialog on this link:

http://common.leeds-art.ac.uk/validate/openday_bookings/test.php

Leave all the fields blank and you click save changes and you notice
that some of the form disappears off the bottom of the dialog.

Thanks

Ryan


[jQuery] Re: [validate] Problem with validation on a form pulling in with Ajax

2008-10-29 Thread ryanhavoc

Your a legend. Thank you. Works now.

On Oct 29, 10:24 am, Jörn Zaefferer [EMAIL PROTECTED]
wrote:
 Looks like the validation is basically working, though you messed
 something up: The submit button has a click handler which always
 returns false, preventing any submit validation to occur.

 On the other hand, if you enter something into a required field, then
 blur, then remove and blur, you'll get error messages.

 So you should just fix that button. One way would be to remove the
 click handler and use the submitHandler option instead to handle the
 submit.

 Jörn

 On Wed, Oct 29, 2008 at 11:14 AM, ryanhavoc

 [EMAIL PROTECTED] wrote:

  Okay, I've replaced the minified files with uncompressed. Refresh.

  Thanks

  Ryan

  On Oct 29, 10:08 am, Jörn Zaefferer [EMAIL PROTECTED]
  wrote:
  Okay, that helps. So far I couldn't find anything obvious though,
  really weird issue. Please replace the minified files with normal
  source files, but makes debugging possible.

  Jörn

  On Wed, Oct 29, 2008 at 10:59 AM, ryanhavoc

  [EMAIL PROTECTED] wrote:

   OK, I've created a test page getting rid off all the over javascript
   i'm using.

  http://common.leeds-art.ac.uk/validate/openday_bookings/test.php

   Same problem.

   I've got a link at the top that loads the form in a dialog box from a
   seperate file, test_add_attendee.php

   And I've also put that same form on the test.php page. The form on the
   page runs the validate however the form i the dialog does not.

   Any ideas?

   Thanks

   On Oct 29, 9:22 am, Jörn Zaefferer [EMAIL PROTECTED]
   wrote:
   Yes, thats why its called a testpage. You need to strip anything
   unrelated so that we can focus on the actual problem.

   Jörn

   On Wed, Oct 29, 2008 at 10:16 AM, ryanhavoc

   [EMAIL PROTECTED] wrote:

Yes, $(#attendee_editForm) is the id of the form being pulling in.

It's difficult to create a test page as it's linked to confidential
data at the minute.

On Oct 28, 11:01 pm, Jörn Zaefferer [EMAIL PROTECTED]
wrote:
Does $(#attendee_editForm) match any elements? A testpage would 
help.

Jörn

On Tue, Oct 28, 2008 at 5:38 PM, ryanhavoc [EMAIL PROTECTED] wrote:

 I have a script that generates a form. I'm pulling this form into a
 dialog box on my main index page via Ajax and trying to attached 
 the
 Validate plugin to the form.

 So I've got this:

 $(a.attendee_add).click(function() {
        //Get href from link
        var addURL = $(this).attr(href);

        //Ajax get from href link
        $.get(addURL, function(data){
                //Display content in dialog box
                $(data).dialog({
                        height: auto,
                        width: auto,
                        resizable: false,
                        draggable: false,
                        position: center,
                        modal: true,
                        overlay: {
                                background: #33
                        },
                        close: function(ev, ui) { 
 $(this).dialog(destroy).remove(); }
                });

                //Attach validate plugin
                $(#attendee_editForm).validate();
      });
      return false;
 });

 However it doesn't work.

 If I don't pull the form in with ajax and instead just paste it 
 into
 my index page and add in $(#attendee_editForm).validate(); to the
 document ready function it works so I know my form is marked up
 properly.

 Has anyone any idea how I can get this working?

 Thanks


[jQuery] Re: Dialog box that auto expands depending on content

2008-10-29 Thread ryanhavoc

Yeah the jQuery UI Dialog plugin.

On Oct 29, 11:43 am, Ettiene [EMAIL PROTECTED] wrote:
 Well I see in Firefox (using Firebug) that if you set div
 class=dialog_box ui-dialog-content ... to have height: auto  then
 it'll expand as the content in the dialog expands.
 You using a Jquery UI dialog plugin?

 Ettiene

 On Oct 29, 12:51 pm, ryanhavoc [EMAIL PROTECTED] wrote:

  I have a form that I pull into a dialog box. I've set the dialog to
  have an auto height as an option and it sets the height when the
  form is pulled in.

  However I'm also using the validate plugin which when displaying an
  error message adds additional height the the form. However the dialog
  doesn't expand with this additional content.

  Does anyone know how I can make it do this?

  You can see a test of the dialog on this link:

 http://common.leeds-art.ac.uk/validate/openday_bookings/test.php

  Leave all the fields blank and you click save changes and you notice
  that some of the form disappears off the bottom of the dialog.

  Thanks

  Ryan


[jQuery] Re: Dialog box that auto expands depending on content

2008-10-29 Thread ryanhavoc

I've fixed it. Set a line of jQuery to set the height to auto for ui-
dialog-content. Wouldn't work through just CSS.

Cheers


On Oct 29, 12:01 pm, ryanhavoc [EMAIL PROTECTED] wrote:
 Yeah the jQuery UI Dialog plugin.

 On Oct 29, 11:43 am, Ettiene [EMAIL PROTECTED] wrote:

  Well I see in Firefox (using Firebug) that if you set div
  class=dialog_box ui-dialog-content ... to have height: auto  then
  it'll expand as the content in the dialog expands.
  You using a Jquery UI dialog plugin?

  Ettiene

  On Oct 29, 12:51 pm, ryanhavoc [EMAIL PROTECTED] wrote:

   I have a form that I pull into a dialog box. I've set the dialog to
   have an auto height as an option and it sets the height when the
   form is pulled in.

   However I'm also using the validate plugin which when displaying an
   error message adds additional height the the form. However the dialog
   doesn't expand with this additional content.

   Does anyone know how I can make it do this?

   You can see a test of the dialog on this link:

  http://common.leeds-art.ac.uk/validate/openday_bookings/test.php

   Leave all the fields blank and you click save changes and you notice
   that some of the form disappears off the bottom of the dialog.

   Thanks

   Ryan


[jQuery] [validate] Problem with validation on a form pulling in with Ajax

2008-10-28 Thread ryanhavoc

I have a script that generates a form. I'm pulling this form into a
dialog box on my main index page via Ajax and trying to attached the
Validate plugin to the form.

So I've got this:

$(a.attendee_add).click(function() {
//Get href from link
var addURL = $(this).attr(href);

//Ajax get from href link
$.get(addURL, function(data){
//Display content in dialog box
$(data).dialog({
height: auto,
width: auto,
resizable: false,
draggable: false,
position: center,
modal: true,
overlay: {
background: #33
},
close: function(ev, ui) { 
$(this).dialog(destroy).remove(); }
});

//Attach validate plugin
$(#attendee_editForm).validate();
  });
  return false;
});

However it doesn't work.

If I don't pull the form in with ajax and instead just paste it into
my index page and add in $(#attendee_editForm).validate(); to the
document ready function it works so I know my form is marked up
properly.

Has anyone any idea how I can get this working?

Thanks