Author Archive

Setting Focus to a Text Input in Firefox with jQuery
Thursday, June 17th, 2010 | Author: dbatesx

On one of the sites I’m working on, there’s a log-in page that’s usually presented in an iframe. I wanted to set focus to the username field when the form was loaded, so I added

$(function() { $('#email').focus(); }

to the <script> section.

(There is also code that resizes the iframe to accommodate the height of the content)

This worked fine in IE7/8 and Chrome.

However, when the page would load in Firefox, the top part of the login form wasn’t displayed; rather, it was rendered, but hidden as if you had scrolled down the iframe to the input field that was in focus (although scrolling is turned off for the iframe).

After enclosing the .focus() in a setTimeout(), the whole form would show correctly, and the field was in focus as desired:

 $(function() {
   setTimeout( // Need the setTimeout wrapper for FF, or top of page isn't visible...
     function() {
       if ($('#email').val() > '')
         $('#password').focus();
       else
         $('#email').focus();
     }
     , 1);
 });


I’d heard of IronSpeed Designer (ISD)  a few years ago, and even downloaded the trial version, but it wasn’t until recently when working with a client that I decided to give it a real shot. They were on a tight budget and wanted a basic interface to enter data into a new database I built for them.

I wanted a quick and dirty database UI generator – I could write the UI myself, but it would take longer and cost them more, so I was looking for a more automated solution.

Before I decided to give ISD a shot, I had a look at Microsoft’s Dynamic Data project they have for Visual Studio. It looks promising, but it’s still not ready for prime-time – particularly, they didn’t have much support for many-to-many table relationships.

ISD out of the box actually created a pretty decent data app – it has many wizards for creating the initial app, the various pages, the various tables and sub-panels on each page, and even for custom code generation. You can create an entire application without writing a single line of code.

On the other hand, it generates ASP.Net code (VB or C#) that you can load up in Visual Studio (it even has a Visual Studio button on it’s menu) and customize the code to your heart’s content – just stay away from the autogenerated sections and ISD won’t overwrite your code when it regenerates the pages.

The documentation is pretty decent, although it’s still sometimes challenging to find how to do something you’re scratching your head over. The training videos are helpful, but there aren’t enough of them (IMHO) and when you want to get something done thats slightly tricky, you have to dig into the Knowledge Base or the user Forum.

ISD is a powerful program, and a valuable tool in my reperatoire. It’s not perfect and has a few quirks yet, but I’m being productive with it.

Playing with Squidoo
Sunday, November 16th, 2008 | Author: dbatesx

I’ve started putting together a Squidoo “lens” or web page (my first one is called “My Word of Wisdom diet”). Squidoo has a pretty decent interface for creating a web page. Creating web pages quickly and easily – easy to understand how to do it – is a great boon for people wanting to get information on the web with out having to know all the intricacies of web-crafting. Being able to customize your website is important to many, also.

As you can tell from MY site, I am using WordPress as my main web editor. It’s a little bit more technical to customize than others, but I like the mix of control over layout and ease of editing.

I tried using Plesk Sitebuilder, but it has very little customization you can do to your site. It comes with a pretty decent supply of templates you can choose from, but if you want to create your own look and feel, it leaves a lot to be desired. Also, it has a number of different page types you can add to your site, like a Blog page, Photo page, etc, but creating and organizing blogs are a pain, especially since I’ve gotten use to the versatility of WordPress.