views:

23

answers:

1

Hi Guys,

Ive never used this site but really need some help with this one.

I have this page http://bit.ly/d6WfDG and in the top left corner if you click learn more you will see my pop up div

So i need to trigger this event but after 1 minute instead of using the link learn more.

Also in the same breathe is it possible to validate and submit the form in request callback without closing the div???

please please help im still learning. ;)

A: 

you could use setTimeout:

setTimeout(10000, function() {
    $('#dialog').dialog('open');
});

In response to validating, it depends on how you set up the dialog, as you could do some validation on the click events of the buttons that you created:

$('#dialog').dialog({
    autoOpen: false,
    buttons: {
        "Confirm" : function() {
             if($('#username').val() == '') {
                  $('#username').addClass('error');
                  //Do some more things like inserting an error message
                  return false;
             }
        }
    }
});
MRW
1 minute would be 60000 milliseconds, not 10000 fyi.
ryanulit
Yeah, it was only an example not exact code, don't want to do all of the work!
MRW
Sorry this didnt seem to work :( or im not doing it right.
Craig
Could you post your code and I will take a look!
MRW