Last modified: 2010-08-05 19:13:39 UTC
Hi. I've got SF 1.9 installed on MW 1.15.1 SMW 1.4.3. I have forms with mandatory fields. However, if I leave those fields blank and hit Save page, it momentarily flashes the "cannot be blank" text next to the fields, but the save still happens! This can be seen at www.prescientsoftware.co.uk/schoolgate_dev Click on "Submit an event" and then click Save page without entering any data. You see the warnings, but the page saves anyway. Cheers Neill.
Hi, I can't duplicate this; I'm guessing it's happening due to some Javascript issues coming from some other extension - maybe Semantic Forms Inputs' "datepicker" input, which looks like it's generating a lot of Javascript. I'd try removing that from the form and seeing if it makes a difference. By the way, "Special:Version" is inaccessible on your wiki, which is odd - possibly a related issue?
Hi Yaron. Turned off the datepicker. Still does it, so that is not the problem. The site is pretty tightly locked down, but I've opened up Version for you. Very odd problem this isn't it. Cheers Neill.
Hi Yaron. This is down to the Show on Select functionality. For example, if you have: {| class="formtable" ! Title: | {{{field|Title}}} |- ! First Name: | {{{field|First Name|mandatory}}} |- ! Surname: | {{{field|Surname|mandatory}}} |} {| class="formtable" ! Ethnic Origin: | | {{{field|Ethnic Origin Group|default=Not Disclosed|show on select=White=>white;Black or Black British=>black;Mixed=>mixed;Chinese=>chinese;Asian or Asian British=>asian;Other=>other}}} |} <div id="white"> {| class="formtable" ! | {{{field|Ethnic Origin|input type=checkboxes|no autocomplete|property=Ethnic White}}} |}</div> <div id="black"> {| class="formtable" ! | {{{field|Ethnic Origin|input type=checkboxes|no autocomplete|property=Ethnic Black}}} |}</div> You can save the form even if first name or surname are left blank. If I remove the show on select stuff it won't let you save if first name or surname are left blank.
Okay, this happens if any fields are set to "hidden". All mandatory fields then stop working. See example at http://scratchpad.referata.com/wiki/Mandatory_Field_Test Click the Add a Mandatory Test Item button. Then in the form press save without filling in any of the fields. It momentarily flashes "Cannot be blank" next to the Title field, but saves anyway. Form is Form:Mandatory Field Test Form. This is quite serious if you are using the automatic page naming functionality of the form, as the fields used to create the page name can be left blank resulting in dud page names. For example, with the above form you end up with an article called ","
Okay, it happens if you have both mandatory and hidden set for a field. Obviously the mandatory is not really needed if the field is hidden, so can be removed. I thought that was it, but I've found that the Show on Select functionality also stops mandatory fields working. It only does it if one of the Show on Select fields is set to mandatory. e.g.: {| class="formtable" ! width=25%|Area Grouping: | {{{field|Area Groups|default=None|show on select=None=>none;North and East Hampshire=>ne_hampshire;West Hampshire=>w_hampshire;South East Hampshire=>se_hampshire}}} |} <div id="none"> {| class="formtable" ! width=10%|Areas: | {{{field|Areas|input type=checkboxes|no autocomplete|property=Area|mandatory}}} |} If any mandatory fields in the form are left blank (not just Areas), you can still save. So bug 24111 is still valid, but I will close this one off.