Thursday, May 17, 2001

Argh!!! My current ongoing project at work involves submitting a form from a web page, and handling the data differently depending on which button was clicked. For instance, clicking "OK" will store all the data in the database, but "Release" will store everything, plus forward all the information on to the next person up the chain of command. I had been doing this by looking at the value of the submit button, but because this is supposed to be a lovely, slick web application (not a mere web page, mind you, but a web application) without any of those ugly ol' form submission buttons, I've been undertaking the job of replacing them all with pretty images.

If you click on an image to submit a form, there is no way on earth to know which image was clicked on the subsequent page. Rather than submitting a value, you get the x- and y- coordinates where the person clicked on the image. Pretty nifty on an imagemap, but useless to me.

So, I determine to create a hidden field, and change the value of that field using the onClick method on the submit image. This works like a champ in IE, but not at all in Netscape. Next, I try using <A HREF="javascript:myFunction('textString')"></A> around the image, and have myFunction set the hidden value and call the submit() method. No dice - it still works in IE, but not in Opera, and it crashes Netscape 4.6 outright. Just in case, I try skipping the function step, and just use the two fairly simple javascript statements right in the HREF property. Same result.

Now, I know none of the firms using this software will be using Opera, more's the pity, and it's possible that this crashing business is just a bug in the older version of Netscape, so I download and try Netscape 6. My form submission works flawlessly. Assuming, of course, you can make it past the booby trap on the main page of the application. On this page, I pop up (I know - ew) a window of alerts for the user (for instance, letting hir know that s/he has stuff waiting for review). If you use the self.close() link I provide in this window, you're golden. If, however, you foolishly think you can get the same result by clicking the close window X in the upper-right corner of the window, Netscape 6 crashes like a Pinto on autopilot. This happens with no other browsers that I've seen.

Someone want to explain to me again what's so bad about buttons that look like buttons?

Whine.

0 Comments:

Post a Comment

<< Home