Thursday, October 6, 2011

My First Facebook Application

Recently I have been exploring the Facebook Graph and API and was asked to create a Week By Week Pregnancy application for OHbaby!.

It basically does the following
- You enter your babies date of birth (Due date calculator) found here.
- OHbaby! sends you a week by week account of what your baby is up to.

We are using Quartz.net to schedule the job which seems to be working pretty well so far (When we get 1000's of user we'll see how it goes)

So far I am pretty happy with how its going. Posting messages to Facebook seem to be working pretty well thanks to the Facebook C# SDK.

Check out the application at http://apps.facebook.com/pregnancyweekbyweek/ to see the flow.

Sunday, September 11, 2011

Jquery Validate Form Submit Before Opening Popup Window

Sometimes you want to open a form submit in a new window.  Think facebook extended permissions popup window.  To achieve this you would do something like the following.

<script type="text/javascript">
    $(document).ready(function () {
               if ($('#myform').valid()) {
                window.open('', 'formpopup', 'width=800,height=600,resizeable,scrollbars');
                this.target = 'formpopup';
             });
    });
</script>

However you wouldn’t want to open the popup window unless the form being submitted in valid.

If you are using jquery.validate then its pretty easy to update the above javascript to this:

<script type="text/javascript">
    $(document).ready(function () {
        $('#myform').submit(function () {
            if ($('#myform').valid()) {
                window.open('', 'formpopup', 'width=800,height=600,resizeable,scrollbars');
                this.target = 'formpopup';
            }
        });
    });
</script>

 

Hope this helps someone.

Thursday, September 8, 2011

Go All Blacks | OHbaby! New Zealand

Here is a Mosaic I put together for OHbaby! in support of the Allblacks in the upcoming Rugby World Cup 2011.

Go All Blacks | OHbaby! New Zealand