From: Antonio O. <an...@li...> - 2010-02-27 17:07:52
|
I realize now that the "|mandatory" parameter specified in my mandatory fields (as explained in Semantic Forms and by Yaron Koren himself, so I can't figure out what's wrong) seems to do nothing: I can submit the form without putting any value in them. E.g. I have in Form: {{{field|Accuracy|mandatory}}} ...and in Template: Accuracy: [[Accuracy::{{{Accuracy}}}]] ...but I can submit with an empty field for Accuracy. -- Antonio |
From: Antonio O. <an...@li...> - 2010-02-27 19:01:37
|
I've tried with a simple form with just one field and the mandatory parameter works as expected. So probably I have to figure out what's preventing it from working in the real form. -- Antonio > I realize now that the "|mandatory" parameter specified in my mandatory > fields (as explained in Semantic Forms and by Yaron Koren himself, so I > can't figure out what's wrong) seems to do nothing: I can submit the form > without putting any value in them. > > E.g. I have in Form: > > {{{field|Accuracy|mandatory}}} > > ...and in Template: > > Accuracy: [[Accuracy::{{{Accuracy}}}]] > > ...but I can submit with an empty field for Accuracy. > |
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? |
From: Robert M. <xol...@ho...> - 2010-02-28 10:37:03
|
Hi Antonio, probably this is not a bug with SemanticForms, but with SemanticMaps. Looks like googlemaps does not support mandatory and the related content validation. Looking at the SemanticMaps code I do not recognize any special handling of the mandatory parameter... But here only Yaron can help, I've not digged in the validation mechanism any further than finding out that the combination hidden&mandatory breaks the validation (perhaps this should be added to the SF doc as well....) Robert. -------------------------------------------------- From: "Antonio Orlando" <an...@li...> Sent: Sunday, February 28, 2010 12:50 AM To: "Semantic MediaWiki Users" <Sem...@li...> Subject: Re: [Semediawiki-user] [SF] "mandatory" parameter does not work in Semantic Forms... > 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? > > ------------------------------------------------------------------------------ > Download Intel® Parallel Studio Eval > Try the new software tools for yourself. Speed compiling, find bugs > proactively, and fine-tune applications for parallel performance. > See why Intel Parallel Studio got high marks during beta. > http://p.sf.net/sfu/intel-sw-dev > _______________________________________________ > Semediawiki-user mailing list > Sem...@li... > https://lists.sourceforge.net/lists/listinfo/semediawiki-user > |
From: Robert M. <xol...@ho...> - 2010-02-27 21:00:35
|
Hi Antonio, do you have any mandatory AND hidden fields? (I think I had the same problem some time ago...) Is your form accessible from internet? Robert -------------------------------------------------- From: "Antonio Orlando" <an...@li...> Sent: Saturday, February 27, 2010 8:01 PM To: "Semantic MediaWiki Users" <Sem...@li...> Subject: Re: [Semediawiki-user] [SF] "mandatory" parameter does not work in Semantic Forms... > I've tried with a simple form with just one field and the mandatory > parameter works as expected. > So probably I have to figure out what's preventing it from working in the > real form. > > -- > Antonio > > >> I realize now that the "|mandatory" parameter specified in my mandatory >> fields (as explained in Semantic Forms and by Yaron Koren himself, so I >> can't figure out what's wrong) seems to do nothing: I can submit the form >> without putting any value in them. >> >> E.g. I have in Form: >> >> {{{field|Accuracy|mandatory}}} >> >> ...and in Template: >> >> Accuracy: [[Accuracy::{{{Accuracy}}}]] >> >> ...but I can submit with an empty field for Accuracy. >> > > ------------------------------------------------------------------------------ > Download Intel® Parallel Studio Eval > Try the new software tools for yourself. Speed compiling, find bugs > proactively, and fine-tune applications for parallel performance. > See why Intel Parallel Studio got high marks during beta. > http://p.sf.net/sfu/intel-sw-dev > _______________________________________________ > Semediawiki-user mailing list > Sem...@li... > https://lists.sourceforge.net/lists/listinfo/semediawiki-user > |
From: Antonio O. <an...@li...> - 2010-02-27 21:16:36
|
It isn't accessible at the moment, and YES, I do have mandatory and hidden fields. So, I'll try to disable the hidden ones, and let you know. -- Antonio > Hi Antonio, > do you have any mandatory AND hidden fields? (I think I had the same > problem some time ago...) > Is your form accessible from internet? > Robert |
From: Robert M. <xol...@ho...> - 2010-02-27 21:30:19
|
Hi Antonio, Having a mandatory parameter which is hidden makes no sense at all, since: * the form would either always fail (if no default is specified), or * the field would always have a value I think the problem is within the java code that checks for mandatory fields. It does not work, when a field is hidden AND mandatory ;) So just remove the "mandatory" flag from all hidden fields... Robert -------------------------------------------------- From: "Antonio Orlando" <an...@li...> Sent: Saturday, February 27, 2010 10:16 PM To: "Robert Michel" <xol...@ho...> Cc: "Semantic MediaWiki Users" <Sem...@li...> Subject: Re: [Semediawiki-user] [SF] "mandatory" parameter does not work in Semantic Forms... > It isn't accessible at the moment, and YES, I do have mandatory and hidden > fields. > So, I'll try to disable the hidden ones, and let you know. > > -- > Antonio > > >> Hi Antonio, >> do you have any mandatory AND hidden fields? (I think I had the same >> problem some time ago...) >> Is your form accessible from internet? >> Robert > > > |
From: Antonio O. <an...@li...> - 2010-02-27 21:44:53
|
Well, I misunderstood your message: I intended I have both mandatory and hidden fields in the same form, not fields with both |mandatory and |hidden parameters ;) -- Antonio > Hi Antonio, > Having a mandatory parameter which is hidden makes no sense at all, > since: > * the form would either always fail (if no default is specified), or > * the field would always have a value > I think the problem is within the java code that checks for mandatory > fields. It does not work, when a field is hidden AND mandatory So just > remove the "mandatory" flag from all hidden fields... > Robert |
From: Antonio O. <an...@li...> - 2010-02-27 23:05:21
|
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? -- Antonio > I've tried with a simple form with just one field and the mandatory > parameter works as expected. > So probably I have to figure out what's preventing it from working in > the real form. > -- > Antonio > >> I realize now that the "|mandatory" parameter specified in my mandatory >> fields (as explained in Semantic Forms and by Yaron Koren himself, so I >> can't figure out what's wrong) seems to do nothing: I can submit the >> form >> without putting any value in them. >> >> E.g. I have in Form: >> >> {{{field|Accuracy|mandatory}}} >> >> ...and in Template: >> >> Accuracy: [[Accuracy::{{{Accuracy}}}]] >> >> ...but I can submit with an empty field for Accuracy. |