Nov
14
2005
3

Replacing Checkboxes and Radio Button’s Programmically with Javascript

There is a great article and javascript on CodeProject.com. The code was originally written by BrainError.

I had to add support for labels, however. If you had a label like this:
<label for="CheckBoxID"></label>

it wouldn’t update the image if you clicked it. I added the following to the js file:

In function replaceChecks, I added one line: inputs[i].onclick = new Function(‘imgChange(‘+i+’)');

Here’s the relevant section of code:

//set image
if(!inputs[i].disabled) {
img.onclick = new Function('checkChange('+i+')');
inputs[i].onclick = new Function('imgChange('+i+')');
}

I also had to add a separate function here:


//change the image if the checkbox is changed.
function imgChange(i) {

if(inputs[i].checked) {
document.getElementById('checkImage'+i).src=imgCheckboxTrue;
} else {
document.getElementById('checkImage'+i).src=imgCheckboxFalse;
}
}

Written by Tom in: Javascript |
Sep
22
2005
1

Inventory of Existing Javascript Autocomplete Controls

I did an inventory of the existing javascript auto-complete controls. Here it is:

Written by Tom in: Javascript |
Sep
22
2005
--

ASP.NET Wrapper for the Google Maps API

Wow! I’ve been planning making something very similar for a project I have in mind. This is probably going to save me several hours (I hope).

http://www.codeproject.com/aspnet/LatLaysFlat-Part2.asp

The Google Maps API allows you to dynamically display a map from Google Maps , add markers to it(those little windows that pop up showing the address and other bits of information), and assorted other cool things.

Here is Google’s own documentation page on the API.

Written by Tom in: ASP.NET,Javascript |
Sep
22
2005
--

Magical AJAX

I’m working on a project now that requires some fancy javascript or AJAX (Asynchronous JavaScript and XML). AJAX allows you to retrieve information from the server without a postback or another request for a web page. This allows much faster web browsing and cooler features.

I’m currently experimenting with this control:
http://www.codeproject.com/useritems/MagicAJAX.asp

It looks to be amazing. I’ll tell you what I find.

Written by Tom in: ASP.NET,Javascript |

Powered by WordPress | Aeros Theme | TheBuckmaker.com WordPress Themes