Mac IE & variables

So I think I’ve discovered an odd thing: IE 5 on the Mac (OS 9) seems to consistently add a space to the end of the name of hidden form fields & also, a space after any commas within field-value lists. I discovered this thusly: In Cold Fusion, I can always call #form.fieldnames#, which returns a list of the fieldnames in a form (which I can then do nice things like loop over and evaluate the contents, without having to know the names of the form fields) (the equivalent is present in all languages, but I’m dealing with Cold Fusion here). I have a script that validates form fields, and in case of an error, spits the user back to the form, with all the form fields passed back as client variables. Consistently, on the mac, when dealing with an invalid form, my script would toss back an error. Why? because a client variable can not have an spaces in its name. And instead of ‘client.name’, on the Mac I was getting ‘client.name ‘. Very odd

The second bit, that it inserts spaces in form-value lists, I discovered also by Cold Fusion throwing back an error on a page that worked fine on the PC, with the same data. I make use of checkbox lists quite a bit, which all have the same fieldname. When the form is submitted, this results in a list like ‘a,b,c,d’. However, on the Mac, this is consistenly passed as ‘a, b, c, d’. Which, when you’re doing something like ListFind(fieldname,”b”), fails (because in the list, it’s actually ” b”, not “b”). Which seems very odd.

What this means is that I’m going to spend tomorrow writing a little script accounting for all of this. Fortunately, I pass all my forms through the same script (the validator), so it’s not so bad—I only have to make these edits in one place (a ListChangeDelims(fieldname,”, “,”,”) & a trim(fieldname) will do the trick), but it is going to add some processing time (ListChangeDelims() seems to be fairly inefficient).

Of course, all of this seems pretty ridiculous to me, and I’m about 50% convinced that I’ve fucked up somewhere. But the consistency of these errors, and the fact that they only crop up on the mac, and never the PC (also, doesn’t appear to crop up in Mac Netscape, although I’ve not done enough testing to confirm that), makes me think that indeed, this is a problem related to how the Mac submits form fields.

My final note of complaint? I’ve no idea whether or not this is some setting I’ve got checked on my Mac, but if I refresh a form-processing page, I get all sorts of unknown variable errors. It’s like the Mac doesn’t keep the form-variables in memory at all, whereas I’m used to the PC, where I can keep going back and back in my history, and refresh at any point and it will still know the passed-in variables from the previous page. Come to think of it, this seems like a cache issue. I’ll check on that tomorrow.

If anyone can shed any light on any of these oddities, I’d be much obliged.