Uploaded image for project: 'Magnolia'
  1. Magnolia
  2. MAGNOLIA-242

Problem with mandatory check of sample form template

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Major
    • 3.0 RC1
    • 2.0 Final
    • samples
    • None
    • Mac OS X, safari

    Description

      Mandatory form check does not work on safari. The problem is the naming of the form elements (as "0", "00", "01", "02" and so on - see files /templates/jsp/samples/templateForm/paragraphs/edit.jsp and /templates/jsp/samples/templateForm/paragraphs/selection.jsp).

      reason:
      ------

      if there is an html code like this:

      <form name="someform" onsubmit="return (checkMandatories(this.name,'whatever'));">
      text: <textarea name="01"></textarea><br />
      <input name="02" type="checkbox" value="1">1<br />
      <input type="submit" />

      then, in javascript of safari,

      document.forms["someform"].elements["01"].type

      will return "checkbox" in safari, although the element is in fact a textarea - this will mess up the whole mandatory procedure.

      Fix:

      Safari obviously treats the string "01" as a number and returns the type of elements[1] - which is indeed the checkbox. Whether this is a bug in safari or not is beyond my knowlegde of the ECMAScript specs. Simple change the namings of the form elements to e.g. "element_01" and "element_02" in the above mentioned files, and also in the file /templates/jsp/samples/templateForm/main.jsp (lines 126 and 127).

      Sala

      Checklists

        Acceptance criteria

        Attachments

          Activity

            People

              kraft Boris Kraft
              sala sala
              Votes:
              1 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Checklists

                  Bug DoR
                  Task DoD