Author: ellen

Javascript validation as a condition for a second function in the same event handler

We use Questionmark quizzing software at my job to create quizzes and tutorials. One of several issues we have had with it has been a login page which did not validate for the kind of ID number we wanted to use. In fact it did not validate at all! We were told that either it couldn’t be done because it would not work with the software (the login page submits some .asp variables), or it would cost us to have it done by their programmers – so we set about trying to make it happen.

The problem was that it uses the onSubmit event to trigger some fancy new window actions. I wanted the validation to take place and stop the new window action as well as the “submitting” action itself. So my first thought was to put a standard validation script on an onBlur event. In other words when people moved the cursor from the validated field to the next field, the validation would occur.

Continue reading

Dreamweaver, Lists, and CSS

Dreamweaver sometimes has trouble assigning styles consistently. When you select some text in Design View, and apply a CSS style, Dreamweaver seems to make a guess as to which element the style should be applied to, and doesn’t always guess right.

For example – try this:
Paste this into the BODY area of a new Dreamweaver HTML document.

Download Code Here

It should look like this:

noListcode.jpg

Continue reading

Installing PHP/mySQL scripts – Tips for Designers

or …
“Just Enough about Unix to get into trouble…”

Determine type of server:
I’ve found that PHP scripts work more reliably on Unix servers than NT. Also, be sure that the server is not running PHP as a cgi script. It really doesn’t work as well. How do you tell?

phpinfo
Upload a little file containing this code:

<? phpinfo(); ?>

Name the file “phpinfo.php” and then view that page online in your web browser. This is a php script that returns all the information about your server environment. In the first table of information, you will find “Server API.” This should be “Apache.” If it says “CGI” you are in trouble. However some things will work fine in this setup, so it’s always worth a try.

Continue reading

Selective JPEG compression in Photoshop

Despite the prevalence of high-speed connections these days, there are times when it is necessary to keep page-download times short. Some target audiences still primarily use dial-up systems.

I had just such a project when designing a home-page for a hospital site. A large percentage of visitors to the site have old computers and slow dial-up connections. A typical user is a middle-aged woman searching for health information for either her parents or children, and usually using a modem. We did not want slow page load time to discourage these visitors from getting the information they came for. Our goal was to get the load time for the home page to under 10 seconds.

The problem was, the home page is content-heavy and features a large photo of hospital volunteers welcoming you into the hospital atrium.

Continue reading

A couple of ways to post code in MoveableType

Thanks to the helpful folks on the MoveableType support forum I now have a couple of ways to post code in my entries.
NOTE: because my new multi-column layout creates issues with form fields in Safari, I’ve also included links to download the code.

1. Install Brad Choates macro plugin, and use it to escape the HTML. Insert this into your templates:

CODE (or download it here)

<MTMacroDefine pattern="m/[code](.+?)[/code]/si">

<pre><MTMacroMatch position="1" encode_html="1"></pre>

</MTMacroDefine>

Continue reading

OSX and .htaccess files

The other day, I was trying to install some script – and needed to edit an .htaccess file that was supposed to be inside the archive. I couldn’t find it – because it was invisible! I forgot that OSX is Unix based.

Here are some instructions to make those files visible on the local side, and still be able to test your site in local mode. (many thanks to Didier Laget for this tip!)

  • Open your httpd.conf file.
  • Look for the following expression : AccessFileName .htaccess
  • Remove the dot left of htaccess.
  • Save the file.
  • Restart the webserver.

Now you can edit htaccess, it will work, and it will NOT be invisible!

Continue reading