Month: November 2012

  • Format JSON – JSONLint

    Hey everyone, Just a site that I came across today that was pretty useful for JSON: http://jsonlint.com/ I’ve been working with jQuery FullCalendar and needed some sample data. It has the option to use a JSON feed but mine wasn’t working for some reason. JSONLint allowed me to both format and validate it. Let me…

  • Fields Missing from jQuery Post – Serialize Data

    Hey everyone, I was using jquery’s serialize method to post completed form data only to find that a number of my fields were missing. //Display loader and disable forms disable_form_fields(true); //Post via ajax $.ajax({ type: ‘POST’, url: ‘uploads/add’, data: $(form).serialize(), success: function(data, text_status, oHTTP){ handle_form_response(data, text_status, oHTTP, $(form).data(‘file_id’)) }, error: function(){ //Hide loader etc set_form_loading(false);…

  • jQuery DateTimePicker with Bootstrap

    Hey everyone, I ran into a bit of trouble today trying to get datetimepicker to work within bootstrap tabs. The dialog appeared however none of the buttons seemed to work. The fields also remained unpopulated. It turned out the the issue was caused by the fact that I’d used jquery’s clone function to duplicate the…

  • preg_match() [function.preg-match]: Delimiter must not be alphanumeric or backslash – CakePHP

    Hey everyone, Ran into the following error while I was mucking around with CakePHP today: preg_match() [function.preg-match]: Delimiter must not be alphanumeric or backslash The error seemed a little weird as I wasn’t using any regex. It turned out that it was because of my custom validation methods. I had marked them as private instead…

  • Remove Disabled Attribute – Twitter Bootstrap

    Hey everyone, I was using Bootstrap’s disabled attribute today and just needed a way to remove it. Once again, jQuery has a quick and easy way to do this: $(‘#my_input’).removeAttr(‘disabled’); There’s a whole heap of documentation on the jQuery site: http://api.jquery.com/removeAttr/

  • Paypal_Adaptive IPN Verification: INVALID – Ruby on Rails

    Hey everyone, I’ve been working with the PayPal_Adaptive gem recently and unfortunately I’ve run into a few issues. The latest of these has been that that my IPN verification was returning an INVALID response from Paypal. I had made a few modifications to the provided payment_notification.rb file in order to accommodate for a few app…

  • How to Reset ID of an Element – jQuery

    Hey All, Just a quick post on how to set the ID of an element (in this case a div) with jQuery. I needed to use this to dynamically clone elements. WOOOOOOOOOOOOW $(‘#my_test_id’).attr(‘id’, ‘my_new_id’); The script above sets the id of div to my_new_id. If you’re interested, there’s a whole heap of documentation on the…

Create a website or blog at WordPress.com