Archive for October, 2009

Selecting radio buttons with clickable text and jquery

Saturday, October 31st, 2009

Nothing frustrates me more than having to hone in my mouse pointer on a tiny radio button. That’s why many web forms today are allowing the area around the radio button to be clickable. I personally believe that if a radio button and its label is isolated in its own td or div tag the entire div or td should be clickable. A more common approach to this issue is making the label clickable.

Let’s take this example

Screen shot 2009-10-31 at 1.29.24 PM

The idea is that when a user clicks ’1 to 24′ the first radio button is selected, when ’25 to 99′ is clicked the second radio button is selected, and so on.  As usual to pull this off we need three resources: some HTML, CSS, and javascript (jQuery since we want this to be easy, right!).

(more…)

Creating a simple sliding navigation with jQuery

Friday, October 30th, 2009

As we know, jQuery not only makes things once considered impossible on the web possible, but makes those things pretty easy to do. I just built a sliding navigation for pukkared.com portfolio and thought I’d share here. Pulling this off requires both CSS and javascript knowledge. I’ll do my best to explain the CSS involved, but maybe Adri can follow up on this post with some more detail on why it works. I’ll also note that practically this navigation would be dynamically driven, but for the sake of simplicity I’m going to hard code the navigation. Maybe I’ll follow this up with a post on outputting your navigation from your database.

(more…)

Template vs. Custom Websites

Thursday, October 29th, 2009

I thought I’d write a post about this topic since Adri and I have had a number of conversations concerning it the past week or so.  Templates, as I’m using it here is a reference to what is known as “cookie-cutter” websites, or those websites that you seem to see everywhere on the web with different colors and logos. I certainly have no intentions of dismissing templates, and as a developer I’m probably more ambivalent towards them than Adri who is viewing them through a designer’s eye.  Instead my thoughts are to be focused specifically on how the two types of websites compare and the uses of both.

(more…)

Creating a random unique formatted purchase order id

Monday, October 26th, 2009

Sorry to use so many adjectives in the title.  It has nothing to do with google searches.  You would assume that creating a unique id of any kind wouldn’t be a big deal right.  I thought so too until I had to do it.  I’m still convinced that there has to be an easier way to do this and I’m just blanking out or something.  Anyways, after looking over this feel free to shoot back any alternative methods for accomplishing this.
(more…)

Pulling your WordPress posts to your website

Monday, October 26th, 2009

We are making some fairly major updates to our website at the moment, one of which includes pulling the postings dynamically from this blog and putting excerpts on the home page of our website.  To do this you will need to either use your website host to install wordpress or download wordpress and install it manually on your own server, although do note that wordpress is run on php.  The reason I bring this up is because if you are working on a Coldfusion server, as I am, it is most likely that the files just won’t work, or, if they do, they will be a maintenance nightmare.

If you install wordpress via your host, then you will most likely need to contact them to get access to the database.  Once you have your host name, user name, and password from your host for your wordpress database you can log in through the phpMyAdmin tool.  Once in you can look for your self on how the database is set up and  what fields you want to pull to your website.  Next you will need to create a dsn to this database.  If you have access to your Coldfusion Administrator create it there, or if you are on shared hosting you will probably have to contact your host and have them set up the dsn.  Once you have the dsn you should be all set to pull the data the same way you would for a database running locally or on the site’s server.

Setting form field focus inside a cfwindow

Friday, October 23rd, 2009

Coldfusion makes creating a virtual window very easy.  A source file can be attached to the window so that when the window loads it loads the contents of a separate file.  So for  example, on your main page you can create a window by inserting the following.

Basic cfwindow:

<cfwindow name=“myWindow” initshow=“true”>

Content inside of window

</cfwindow>

(more…)

jQuery and Coldfusion Builder

Friday, October 23rd, 2009

I just noticed that in the Coldfusion Builder preferences there is an option to code hint jQuery. Mine was not activated by default, but can be by going to preferences – HTML – Editors – Javascript – Code Assist. In the dialog is a list of javascript to choose from. Just make sure that the jQuery 1.3 box is checked to fulfill all of your jQuery code hinting desires.

Body Mass Index (BMI) Calculator

Friday, October 23rd, 2009

This is a simple calculator for calculating a person’s body mass index (A.K.A. BMI), which I know little about.  I just built this for a client and thought I would share the code here until we get the new and improved pukkared site up and running with its own webservices page where this function (along with others) will be available as a webservice for use. Until then however, the code follows.
(more…)

Checking Run Environment Dynamically with Coldfusion

Friday, October 23rd, 2009

I’ve run into a problem in the past of switching between the local development environment and the production environment for a website and always having to change my base file path in the Application.cfc file.  I always set my base file path in the Application file so that if in the future a site’s domain changes I can quickly make a global sweep on the website changing any absolute paths to whatever the new URL is.  However, during production we usually work in two environments.  One is locally, and another is under a VPS IP or dedicated server IP.  So we have two base URLs like locally – http://localhost:8500/rootDirectory, and on a VPS (or the like) – http://555.55.555.55/rootDirectory, and once this goes into production will become http://www.mySiteName.com.
(more…)

Using jEditable Plugin for jQuery

Friday, October 23rd, 2009

I began working last night with the jEditable plugin for jQuery.  The point is that html output is converted to a form field for editing, and after editing a confirmation button or just Enter can be pressed to return the new value to the html output.  Quick simple updates is the real point.  Although I don’t think I would use this within a website, I do find it very practical for website administration.  The javascript library can be found at the jEditable website.  (One note though, is that the plugin is not downloaded as a js file like many other plugin libraries.  Instead (at least for me), the code just opened in a new window.  Really not a big deal however.  Just copy and past the code into a .js file in your editor, and then include that file just below your jQuery.js file in your main file.)
(more…)