ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Max Value Problems in FireFox

August 16, 2011 8:12pm

Subscribe [3]
  • #1 / Aug 16, 2011 8:12pm

    Ben Lilley

    214 posts

    So here’s one that I’ve wasted far too many hours tracking down, it’s simple in hindsight but took a while to work out.

    When I’m creating text inputs in ExpressionEngine quite regularly I don’t want to set a hard limit on the field of a certain amount of characters. Instead I empty the ‘max value’ field and leave it empty assuming this would be fine as I’ve never had a problem. However recently I had a client complain that they couldn’t edit a few random fields in Firefox.

    Turns out that if you leave the max value value empty ExpressionEngine defaults to 0 as the field value, which gets ignored in Safari/Chrome (makes sense since no point having a text field that can’t be used) but FireFox and I believe Internet Explorer take this value and don’t allow you to type in the field at all.

    Very frustrating since now I need to go through all my fields and set bogus values for them all.

    Cheers,
    Ben

  • #2 / Aug 17, 2011 10:26am

    Kevin Smith

    4784 posts

    Thanks for posting this, I’m sure it’ll help others! I’ve moved this to the Community Help forum so others can see it as well.

  • #3 / Aug 17, 2011 5:27pm

    glenndavisgroup

    436 posts

    Hi Ben,

    One quick fix you can add would be some jQuery code to the header or footer that would search the page for any input fields with maxlength=“0” or maxlength=”” and remove the property. This might be the quickest way to get around the issue while you go through and manually fix the forms. I hope that helps.

    Mike

  • #4 / Aug 17, 2011 8:10pm

    Ben Lilley

    214 posts

    Thanks for the tip Mike, I might try that out to see if it helps.

    Kevin, I don’t agree with moving this to Community Help, I didn’t make it very clear in the original post but I consider this an issue within ExpressionEngine one way or the other. Here’s my reasoning:

    1) There should be a way of not putting a limit on a text input, I’d assume this is by leaving the field empty or putting in 0 as why would you want a text field with no content?
    2) If this is expected behavior in terms of 0 means you can’t type in the field at all then it should work the same across all browser shouldn’t it?

    Let me know.

    Ben

  • #5 / Aug 18, 2011 10:37am

    Kevin Smith

    4784 posts

    That’s totally my fault, Ben. I thought you meant to just inform the community about what you’d found. Typically bug reports are just reported directly in the bug tracker, and I was unfortunately a bit too much on auto-pilot when I read your post yesterday. I’ve filed a bug report on your behalf here. You might want to add a comment to the report so that you’ll get updated when there’s a fix.

    Thanks for bringing this to our attention!

  • #6 / Aug 18, 2011 10:46am

    Kevin Smith

    4784 posts

    And to answer your two questions…

    1) There should be a way of not putting a limit on a text input, I’d assume this is by leaving the field empty or putting in 0 as why would you want a text field with no content?

    I agree, but that way should be to leave the field blank. It’s conceivable that one might want to merely display to the web viewer text already in an input field without allowing them to edit it, and that’s why Firefox and Internet Explorer behave this way methinks. (The univeral method for disabling fields is to include the disabled parameter. Mayhaps FF and IE’s behavior of maxvalue=“0” is the way it is for backwards compatibility, I’m not sure.) Regardless, if you put nothing in the Channel Fields maxvalue field, the maxvalue parameter shouldn’t even show up in the HTML input tag. Any numerical value, on the other hand, should, even if it’s zero.

    2) If this is expected behavior in terms of 0 means you can’t type in the field at all then it should work the same across all browser shouldn’t it?

    One would hope, but different browser makers have chosen to give a zero maxvalue different behaviors. I don’t understand it either, but I’m sure they have their reasons.

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases