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.

4 Replies to “Mac IE & variables”

  1. Steve~

    You can loop over most variable collections (form, session, url, client, etc) with the <cfloop> tag, enabling you to bypass the #form.fieldnames# variable. I had to do it the other day, because the browser actually assembles the form.fieldnames thing and I was adding variables to the form scope in the code itself.

    Goes a little somethin’ like this:

    <cfloop collection=”#form#” item=”x”>
       #variables.x#
    </cfloop>

    http://livedocs.macromedia.com/cf50docs/CFML_Reference/Tags64.jsp#1101183

    Nice site btw

  2. Steve~

    You can loop over most variable collections (form, session, url, client, etc) with the <cfloop> tag, enabling you to bypass the #form.fieldnames# variable. I had to do it the other day, because the browser actually assembles the form.fieldnames thing and I was adding variables to the form scope in the code itself.

    Goes a little somethin’ like this:

    <cfloop collection=”#form#” item=”x”>
       #variables.x#
    </cfloop>

    http://livedocs.macromedia.com/cf50docs/CFML_Reference/Tags64.jsp#1101183

    Nice site btw

  3. OH AND ONE THING ABOUT MAC!!!

    I was set loose building our company intranet for a year and a half (that rocked, hard) so I was always doing crazy stuff w/ CF/JavaScript. Well, we had a Mac or two up there I had to support, and the issue I consistantly had was manipulating form elements and data with JavaScript on a Mac (OS9). I did a bunch of things where you could click a button and it would add a new form element to the page, but it simply would NOT add it to the FORM (ie, when you actually submit the form, the field wouldn’t submit with the others, no matter what).

    PC’s? Oh yeah, sure! Totally. Mac’s had issues with dynamic form items placed on the page.

  4. OH AND ONE THING ABOUT MAC!!!

    I was set loose building our company intranet for a year and a half (that rocked, hard) so I was always doing crazy stuff w/ CF/JavaScript. Well, we had a Mac or two up there I had to support, and the issue I consistantly had was manipulating form elements and data with JavaScript on a Mac (OS9). I did a bunch of things where you could click a button and it would add a new form element to the page, but it simply would NOT add it to the FORM (ie, when you actually submit the form, the field wouldn’t submit with the others, no matter what).

    PC’s? Oh yeah, sure! Totally. Mac’s had issues with dynamic form items placed on the page.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: