single text input form submit in IE

by jim.mayes - (add comment)

The previous form submit issues with IE post has generated some conversation in the post comments. In the original post I looked at the situation where you have a form with just a single text input and a submit button. The conversation developed to look at the situation where you have a form just with a single text field, no submit button at all. I did some hacking and came up with a fix which I thought warranted a new post.

To lay things out, single text field, no submit button. Type into the field and simply hit ‘enter’ is what we’re going for… in IE

Read the rest of this entry »

Form submit by enter key and Internet Explorer

by jim.mayes - (9 comments)

Ran into an (other) interesting Internet Explorer bug. Seems that if you have a form with only a single text input, hitting the enter button will not submit the form in IE.

HTML:
  1. <form action="" method="post">
  2.         <label for="user_name">User Name</label>
  3.         <input type="text" name="user_name" id="user_name" />
  4.     </fieldset>
  5.     <fieldset class="button">
  6.         <button type="submit" name="submit" id="submit" title="Verify User Name">Verify User Name</button>
  7.     </fieldset>
  8. </form>

The solution is to hide an additional disabled input for IE to find, using IE conditional Comments and hiding it from view with some CSS.

HTML:
  1. <form action="" method="post">
  2.         <!--[if IE]><input type="text" style="display: none;" disabled="disabled" size="1" /><![endif]-->
  3.         <label for="user_name">User Name</label>
  4.         <input type="text" name="user_name" id="user_name" />
  5.     </fieldset>
  6.     <fieldset class="button">
  7.         <button type="submit" name="submit" id="submit" title="Verify User Name">Verify User Name</button>
  8.     </fieldset>
  9. </form>

Now the form will submit in IE when you hit the enter key!

clendar.class.php updates and new version release

by jim.mayes - (add comment)

Just put up the new version of my php calendar class (version 2.7). This version integrates a fix for the start of the week bug people were seeing with PHP version < 5.1. Also, the license has changed. The class is now licensed under the GPL for use in open source projects. So if you want to use the class in a project that you plan to release under the GPL or compatible open source licenses, you now can. If you need to use the class in a closed source project, or don't want to distribute your project (ie commercial use) please contact me.

And last, but by far not the least... I setup the project on Google Code. The code is available in SVN or as a zip download. So grab the newest version here

http://code.google.com/p/calendar-class-php/

I'll be filling in the Wiki with documentation shortly. In the mean time the old calendar.class.php page still has some usage info and links to my other blog posts about using the class in many interesting ways. In addition, the release version still contains plenty of use examples and you can always leave a comment or use the contact form if you have any questions.

calendar class start of month wierdness and PHP < 5.1.0

by jim.mayes - (add comment)

A couple of calendar class users have noticed a problem with the first day of the month when using the class with versions of PHP earlier than 5.1.0. The issue was introduced with the last upgrade when I switched to date("N") for calculating the day that the first of the month falls on. date("N") was added in PHP at version 5.1.0 so earlier versions will have this problem. The quick remedy appears to be switching things back to use date("w") for this calculation.

Sorry for any inconvenience this may have caused people. I'll have a fix in the next couple of days to address the issue fully.

Testing IE Conditional Comments in development

by jim.mayes - (add comment)

CSS rendering inconsistencies in the various versions of IE are a well known problem. IE's proprietary Conditional Comments are really the best practice solution for addressing CSS issues in IE. Which makes the so called "stand alone" versions of IE an invaluable tool for testing CSS layouts. evolt provides a great collection of stand alone IE versions going back to version 3 (that's further back than I care to think about). And with the release of IE7 looming in the not so distant future, it's important to have a stand alone IE7 version in the arsenal as well.

The problem with all of these stand alone versions is that when they are installed along side a primary installation of IE6... they report their version as 6 and break the use of CC.

Today I was again dealing with the madness that is IE + CSS and decided to go looking around to see if there was anything new that others are doing to deal with IE sniffing. Amongst the new debates popping up around some slipping back into the taboo practices of javascript sniffers... I happened upon a comment in the IE7beta3 post that explains a simple way to fix IE CC for multiple "stand alone" versions with a quick registry key edit.

Open Regedit
Start -> Run -> Regedit

Find
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Internet Explorer\Version Vector

Rename the key there named IE to something like xIE

All stand alone versions now report their correct version, and IE Conditional Comments are restored to functionality! If nothing else, this makes Conditional Comments a little easier to work with. Though they are still cluttering up the top of my html pages. If only MicroSoft would have had the insight to implement this proprietary feature so the CC could live in the external style sheet instead of the html…