Fork me on GitHub

compensating for IE button behavior with translations?  Bottom

  • I need to know if this is an issue at all or if I am just misunderstanding everything.

    as I understand it, IE for all versions < 8, doesn't follow correct behavior with respect to the <button> element. Instead of submitting the value, it submits the innerText, or the text between the <button> and </button> tags.

    Of course, in Zikula, we are attempting to convert these displayed texts to gettext so that they may be translated. Then, when the form is submitted, the value submitted by IE will be a translated value and in every other browser, the value is what was set by the value attribute (e.g. value=""). This creates a problem when processing the form as the value to test will change based on translation.

    so you cannot do

    Code

    if ($mysubmitbutton == 'value')


    so is the solution to do this?

    Code

    if ($mysubmitbutton == __('value', $dom))


    or is there a better way? or am I off my rocker?

    also - Zikula is making use of buttons with images all over the place now - how is this affected? what value does IE pass when an image is between the button tags?

    I know most of us use FF and Chrome and stuff and I am NOT looking to start a flamethrowing match about IE here, but many people still use IE < 8. is this a concern?

    (as I post this, I notice that Dizkus has used javascript on their buttons to solve the issue - maybe).

    icon_frown
  • for that matter, the same translation issue can apply to standard inputs:

    Code

    <input type="submit" name="form_action" value="<!--[gt text='Preview']-->" />
        <input type="submit" name="form_action" value="<!--[gt text='Save']-->" />

    now the value that is shown is translated and the value to be tested for is translated...
  • I think only IE6 has this button problem. AFAIK IE7 is fine with buttons (see also http://msdn.microsoft.com/en-us/library/ms535211(VS.85).aspx ). For IE6 there are JS solutions out there that solve it (e.g http://www.kopz.org/public/documents/css/multiple_buttons_ie_workaround.html ).

    --
    campertoday.nl, Module development, Dutch Zikula Community
  • things I had read elsewhere suggest otherwise. but that still doesn't change the issue that the value in a standard input tag is translated.

This list is based on users active over the last 60 minutes.