Archive for the 'Beginner' Category

This was tons of fun, in a few easy steps:
**NOTE: I am installing using CGI and not ISAPI

Download and unzip PHP package to desired PHP directory (eg: C:\PHP)
Add ‘;c:\PHP’ (or wherever you stored your PHP directory without quotes) to your PC Path. To get there go to “my computer” -> right click > properties > [...]


I really do like Coldfusion. No, really =).
However, here is an ever so useful tip brought to you by me – CodeStar.
So, CFoutput should be on the forefront of every beginner ColdFusion scrip-tor. However, lo- and behold, I wanted to group my results. Simple right? No, not so much. In order to use the [...]


As many of us know by now, it is never best to only validate fields with client side code. You must also validate on the server.
As I was writing code today for a multi-page form, I was trying to think of the best way to validate fields. Although the below is verbose and written [...]


Simple check all with Jquery:

function checkAll(el, fieldName){
var checkBoxes = $(‘input[name=' + fieldName + ']‘);
var curValue = el.value;
if(curValue == ‘Check All’){
$.each(checkBoxes, function() {this.checked = true});
el.value = ‘Uncheck All’;
} else {
$.each(checkBoxes, function() {this.checked = false});
el.value = ‘Check All’;
}
}

How to use?
Pass in the “this” keyword as the first parameter. Second, pass in the name of the fields that [...]


Creating a javascript select box with numbered selections in multiples:

var i;
var totalRows = 20;
var selectBox = document.getElementById(‘thisSelect’);
for (i = 1; i < = totalRows; i++ ){
if( (i % 5) == false ){
var newOption = new Option(i, i);
selectBox.options.add(newOption);
}
}

What’s going on?
Initialize variables:

var i;
var totalRows = 20;
var selectBox = document.getElementById(‘thisSelect’);
var newOption;

Loop over total rows:

for (i = 1; i [...]


I am a programmer. However, I am also a lover of any language – be it computers, foreign, or even my own. Therefore, I like to read, I love to learn, and I love to understand. One of the areas in my life that this applies to is creating beautiful code. And of course, as [...]