From: Antonio O. <an...@li...> - 2010-02-27 23:51:03
|
Looking into the generated html, I see that probably I'm dealing with a Semantic Forms bug: {{{field|Location|input type=googlemaps|width=780|height=540|centre=40.89282261530705,16.644287109375|zoom=8|autozoom=off|mandatory}}} {{{field|Accuracy|mandatory}}} Semantic Forms renders (excerpt of relevant parts): - - - ---------------------------------------------- - - - ... function validate_all() { var num_errors = 0; if (! validate_mandatory_field('input_3', 'info_3')) num_errors += 1; if (! validate_mandatory_field('input_4', 'info_4')) num_errors += 1; if (num_errors > 0) { ... } ... <script... <input id='map_google_coords_1_3' name='Architettura[Location]' type='text' value='' size='40' tabindex='3'> <span id='map_google_info_1_3' class='error_message'></span> <p> <input id="map_google_geocode_1_3" size="30" name="geocode"... <input type='submit' onClick="showGAddress... </p> <div id='map_google_1_3' class=''></div> <script type='text/javascript'>/*<![CDATA[*/ ... /*]]>*/</script> ... <select id="input_4" tabindex="5" name="Test[Accuracy]" class="mandatoryField" > <option value=""></option> ... </select> <span id="info_4" class="errorMessage"></span> - - - ---------------------------------------------- - - - I'm using Semantic Forms 1.8.8, and Semantic Maps 0.5.1, on MediaWiki 1.16. How can I fix this and have both Location and Accuracy fields mandatory in my form? -- Antonio > I've succeeded in isolating the problem (but not found a solution). > > I have only one two fields in the form with |mandatory parameter: > > {{{field|Location|input > type=googlemaps|width=780|height=540|centre=40.89282261530705,16.644287109375|zoom=8|autozoom=off|mandatory}}} > > {{{field|Accuracy|mandatory}}} > > > The code above does not allow the "mandatory management" javascript to > work as expected. > Instead, stripping away the |mandatory parameter from the map field, > fixes > the problem: > > {{{field|Location|input > type=googlemaps|width=780|height=540|centre=40.89282261530705,16.644287109375|zoom=8|autozoom=off}}} > > {{{field|Accuracy|mandatory}}} > > > The code above does work, if I leave Accuracy empty the mandatory check > complains. > So, now the problem is: how can I make the Location field mandatory? |