Repeatable Form Fields in WordPress

One of our clients required a contact form with repeatable form fields that allows their staff to submit time sheets, mileage sheets and holiday requests. We ended up building a custom jQuery plugin to handle the dynamic form fields. Creating client work with open source software and developing open source software at the same time makes everyone happy.

WordPress Contact Forms

html Contact forms have been a staple of the web since forever. They allow your users to contact you, enquire about services, book appointments, send information or register their interest. Receiving information from your clients and potential customers is key to everybody’s business. Therefore finding a good WordPress plugin to handle your web forms is paramount to a successful website web project. As always there are a deluge of plugins for WordPress that do a good job of creating forms, sending emails and collecting data.

After using WordPress for so long we have of course got a firm favorite when it comes to website contact form plugins. We nearly always use Contact Form 7 to create our clients’ contact forms. We also additionally install the Flamingo plugin which stores any submitted forms in the WordPress database for easy retrieval.

Contact Form 7 usually meets all of our requirements. If we do find it lacking there are many addons that can extend the already extensive functionality even further. Dynamically repeatable form fields is something that Contact Form 7 doesn’t do out of the box which isn’t really surprising. Other great WordPress contact form plugins such and Gravity forms and Ninja Forms also lack a repeatable form field groups feature.

Plugins and Addons vs Custom Development

Going down the plugin hunting route can sometime end in a time consuming disaster. Spending time researching what plugin is going to work, only to find that it doesn’t quite do what you expected is not good. If the developer of the plugin in is nowhere to be found or the plugin has not been in active development for months then this could be a lot of time and effort down the drain.

On the surface this problem seem fairly straight forward. We decided to create a simple jQuery script to add the functionality that we needed. Once the development was under way we quickly realised that this might not be as simple as it seemed. Every input field needs a unique name so the script needed to be aware of how many fields it had added.  jQuery is good at cloning element but making multiple clones with unique name is not totally straight forward. Of course this wouldn’t be as simple as we first thought.

Repeatable Form Fields Plugin

After a bit more time and work the simple jQuery script had evolve into an equally small jQuery plugin. Form Field Repeater is pretty specific and has limited functionality. What it does do, it does pretty well and it was fun to build and is fun use.  I’ve open soured it on GitHub and set up a simple demo site to show off its awesome power. Hopefully this might be useful for some one as it is. If I can find the time I might and a feature or two to make it a bit more versatile. If you want to add your own features, go ahead and fork it on GitHub.

Kitchens and bedrooms in Talbot Green

kbs-logo

Talbot Green is full of many wonders but did you know we have our very own Kitchen and Bedroom studio? Ready and waiting for you, the house do’er upper to go along and plan your dream kitchen or bedroom.

Forget the high street chains with all their sales and over selling, go somewhere where you deal with people who are just like you. They are not there to sell you something you don’t want to make their targets or cut the price of a product because it isn’t selling.

When you go to the Kitchen and Bedroom studio you will meet Rob or Geraldine, a husband and wife team that will have no doubt had one of their own kitchens in their own Homes and can personally vouch for what they are like to use on a daily basis.

Budgets, styles and weird shaped rooms

The Kitchen and bedroom studio have eight go to manufacturers they use for their kitchens. They range in price from budget to bespoke and come in various styles to suit you and your home. A traditional house – tick. A modern home – tick. A home with weird shape rooms – (yes they cover that too) – tick.
They have been the business a long while so you will get experience, knowledge and their expertise in an industry they have built a successful business within.

One stop shop for you home

They also have a magic trick up their sleeves, they don’t just sell the kitchens and bedrooms, they offer a complete service. A dedicated team of fitters, builders and go to electricians, plumbers, basically all the trades you need for doing up your house are available to you through the Kitchen and Bedroom Studio. Both Rob and Geraldine have very high standards so you can rest assured knowing that these people have been vetted within an inch of their lives and given the golden seal of approval.

Shop Local

Shopping here also ensures that you are giving back to your local area. We are big on shop local here at AmberCouch and a large percentage of our clients base, is here in the CF72 area , Cardiff and South Wales. We believe that by growing your local network everyone benefits, the income stays in your area and you can better build long standing relationships with people you can walk to meet with or just pop in the car for a short journey.

If you would liek to know more about the Kitchen and Bedroom studio you can visit their website or call them on 01443 223 052

Website Design for Speed

We know clients love Google. Being higher in the Google rankings for appropriate search terms will almost certainly increase traffic and that in turn will increase leads and conversions.

When trying to climb the search results ladder, anything you can do to improve your website and make it better for your users can be the difference between being ranked above your competitors or not. Improving the speed and performance of your website is one area that may have been overlooked if you had your site built just a few years ago but today it is an essential part of any design.

Mobile Website Performance

Screenshot - Gooogle search results. Google loves websites that perform as well on mobile devices as they do on desktop. Websites that respond to the users device are label as “Mobile-friendly” in the search results page Google provides this tool for testing your website. If your site performs poorly on mobile this test will let you know.


Website Design – Load Time

Screenshot - Google PageSpeed InsightsHow fast your site loads is also a big deal for Google because it is a big deal for your users. If your site takes longer than 2 seconds to load then your users are going to drop. Again Google provides a tool, PageSpeed Insights, to measure how fast your page loads. It also tells you how you can improve this.


We have just created a redesign for Stretton Climate Care and along with a fresh new look and modern design we have also made sure that it is really fast and mobile friendly. This is something that has now become the de facto standard in our web design process.

WordPress – Remove Empty p Tags

So you know we all love WordPress. That being said, there is a lot of things that can bug the heck out of your average developer when building sites with WordPress. For me it the dreaded wpautop function! That’s the little blighter that is responsible for creating a lot of extra line spaces in many of your WordPress posts. It might be a br tag or it might be and empty p tag. Do you want to use html comments in your WordPress post? Not without the wpautop function wrapping them in p tags and causing unsightly white space all over your page. Damn it WordPress stop messing with my markup!

How to Remove empty p tags in wordpress

So there are 2 basic choices if you want to stop wpautop from adding empty p tags

  1. Use PHP in your functions.php file to remove the wpautop filter
    remove_filter('the_content', 'wpautop');
  2. Use jQuery to clean up all those empty p tags after the page has loaded
    $('p:empty').remove();

The problem with both these methods is they are global, They will happen on every post, every page even all your custom post types. This might not be a problem for you but for me and your basic WordPress author those automatic p tags come in handy when writing simple posts or pages.

Remove empty p tags from specific pages in WordPress

If you want to kill that wpautop function on specific page, for instance when you need to just dump a big blob of custom markup in to the content field then I created a WordPress plugin that will work for you.

Simply download this plugin from the Github repo, upload and activate the plugin and it will add a checkbox to all your posts and pages. Just check that box and bam no more empty p tags on that page or post.

 

Get out the house and clear your mind!

Sunday – the day of rest. That does not need to mean you sit in front of the T.V all day, doing nothing. This last week has been a hetic old week for Ambercouch. Mainly due to recently coming back from a road trip in Arizona but largely to do with the continued blame assigned to jet lag for all my short comings this week.

I’m tired – it’s the jet lag. I’m too busy – It’s the jetlag. I’m behind on my work – It’s the jetlag. Well, no it’s not, quit complaining and organise yourself. There are 24hrs in the day, everyone has the same amount of time each day. Getting outside to clear your mind each day or every couple days can and does actually help bring some clarity to your world.

Continue reading

Networking in Pontyclun – Grow your business

Come to Pontyclun Networking!

Every other Wednesday AmberCouch meet up with other local businesses from the Pontyclun area at Sovereign Connect. We joined this group at the very end of 2014, maybe you have read the other article we wrote when we were undecided what to do. For us the process of networking wasn’t something we were used to. We have never needed to go out and find work, it all comes through our own website or word of mouth. However, we are a husband and wife team and we work at home, we thought it was a good idea if one of us occasionally left to meet some real people face to face. The novelty!
Continue reading

Which Responsive Carousel Slider?

Love them or hate them a responsive carousel slider is still a thing. Of course it needs to be a responsive and touch enabled, but apart from that, which carousel should you use? This is around up of three carousel I tried when adding a feature to this site.

Responsive Carousel Slider

Lory

http://meandmax.github.io/lory/

A great responsive carousel that doesn’t rely on jQuery which is a real bonus and it is tiny, at tad over 3kb minified. I set it up really easily but it didn’t work with fluid width items so it was no good for me but if I was using fixed width items and breakpoints I would have stuck with Lory.

Owl Carousel

http://owlgraphic.com/owlcarousel/

Owl Carousel relies on jQuery but it looked like it worked with items with fluid width which is what I needed. Unfortunately it’s not been updated for 2 years! There is a version 2 but it is currently in beta.

Flickity

http://flickity.metafizzy.co/?

Flickity doesn’t rely on jQuery and it works with fluid widths and it is made by the mighty metafizzy who have made some great products like Masonry and Isotope. The only thing that lets it down is that it is masive! 57kb minified.

Responsive Carousel Slider Round Up

I took the kb hit and went with Flickity it was simple to set up and did everything I asked. My javascript is loaded at the bottom so I can live with the extra weight.

Got any Carousel recommendation? leave a message in the comments.

Poster Design – Chapter Maibock Beerfest!

Poster Design
Chapter Arts Centre in Cardiff is know for it’s seasonal beer festivals. Next up is the popular Maibock beer festival which will take place at Chapter at the end of May, 20th – 24th.
There will be a tasty selection of new brews, established favourites and authentic BBQ food specials to celebrate the transition from winter to spring. Enjoy a pint of well-crafted German beer in the spring sun!
Each beer festival Ambercouch create a new poster design – always different from the one before. Although we do always include something from a previous poster, we started doing this years ago and now including something from a previous poster has become an in office challenge. Sometimes it is obvious, sometimes it is the tiniest detail that I doubt nobody notices.
Continue reading