Working with Hubspot forms onFormSubmit

October 13, 2021 at 11:02 am | Programming, web.

Getting values from the hubspot form in it’s onFormSubmit handler can be pretty tricky so here is a quick tip.

Add the onFormSubmit closure function to the hbspt.forms.create script and then use .find() to get the value of individual form elements that you need. At that point you can use them to pass to tracking or cookies or whatever.

<script>
  hbspt.forms.create({
	region: "na1",
	portalId: "555121212",
	formId: "23845959d-1d80-4af7-81ae-5b3f5c52adf483",
	onFormSubmit: function($form) {

		var firstname = $form.find("[name=firstname]").val();
		var lastname = $form.find("[name=lastname]").val();
		var email = $form.find("[name=email]").val();
		var jobtitle = $form.find("[name=jobtitle]").val();
		var company = $form.find("[name=company]").val();
		
	} 
});
</script>

Finite and infinite games

April 15, 2021 at 12:05 pm | blabbing.

Something I ran across recently that I liked.

There are two types of games: finite games where rules are known & an end is set, & infinite game, where the rules can change and the end is unknown, & rules can change. Your outlook/beliefs will determine the game you believe you are playing.

Read more »

Fix for svg background images in IE11

June 2, 2020 at 2:17 pm | web.

Problem: Sometimes SVG images when used as background images do not show up correctly in IE11. This can sometimes show up as not covering the specified element background.

The trick here is the add the height and width back into the SVG as it might have been stripped out. Take the height and width from the viewBox attribute.

Before

<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
	 viewBox="0 0 2785.8 708.6" >

After

<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
	 viewBox="0 0 2785.8 708.6" height="708.6" width="2785.8">

Git and WordPress on a shared hosting environment

June 1, 2020 at 1:57 pm | Programming, web, Wordpress.

If you have a small blog or series on blogs on a shared hosting environment and and want to take advantage of GIT but still want to let your hosting provider keep your WordPress up to date, you can easily setup GIT repos and deployment to make your life easier.

Shared hosting services are great for a small site or if you have a bunch of small sites where you can setup different projects and not have to worry about the server environment or keeping WordPress or Drupal up to date. Hosting providers like Dreamhost, Bluehost, HostGator, SiteGround etc. are a great solution for some because they provide the hosting and upkeep of the WordPress install and you are free to add themes and plugins and do custom development on top. Most of these providers will automatically update the core WordPress on a regular basis. For business and enterprise class WordPress hosting I prefer Pantheon.

Read more »

Mobile ABV Widget

October 17, 2018 at 2:25 pm | blabbing.

I was reminded that I made this mobile friendly Alcohol by Volume widget the other day.
It uses basic slider or text inputs to do the calculations associated with finding the ABV in your beer/wine/cider. I made it because I couldn’t find an easier one online. It uses basic jQuery UI mobile components.

You can get to it here:
https://www.fuzzyraygun.com/gravity/

One of these days I’ll put it in Vue.js and let people store their calculations.

Ember on Apache

February 22, 2017 at 9:50 pm | Programming, web, Wordpress.

Ran into this recently and it reminded me of how WordPress does URL permalink routing. Since Ember routes are handled by the index this helps Ember on Apache route to links, especially when you are coming directly to a link or deep linking.

This should go in the root .htaccess file in the same way that WordPress needs as similar thing.

RewriteEngine On
RewriteRule ^index\.html$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule (.*) index.html [L]

Default font-family not working in Outlook 2010, 2013 – Fixed

November 28, 2016 at 4:29 pm | Design, Email, Programming, web.

If you are wondering why Outlook 2010 and 2013 email clients will not render your font-family tag correctly, you are not the only one.

This is a known issue. So despite your fallback fonts being declared these older Outlook clients will use Times New Roman instead. You can always use the code below in the head to get around certain problems of old email clients. You probably won’t be able to get it to display nice Google fonts but at least you won’t be stuck with Times.

Validate AMP pages – New Relic

October 28, 2016 at 7:53 pm | Programming, web, Wordpress.

If you are looking to validate your AMP pages there is a nice tool provided by the AMPproject here. https://validator.ampproject.org/.

One of the things that may cause problems with AMP validation is the inclusion of New Relic JS in the head and footer of AMP pages. If you have a new relic instance running you may want to turn off the autorun for these template pages.

And yes, that is how that function is spelled. Link>