July 9, 200322 yr Hello. I've run into an odd problem using value lists on an intranet server. I have a field, "Assigned", with value list "Assigned" and the field is defined in Options/Validation as "Not Empty", member of value list "Assigned" and "Strict: Do not allow users to override validation." While it will not allow a new record direct in the FileMaker database without a selection in that field, on the web with pulldown list for the value list it will allow a new record to be created without specifying a choice. In case it matters, the field format on the web is (using [ and ] here): Team Assigned to: [select name="Assigned" size=4] [FMP-VALUELIST: Assigned List=Assigned] [option [FMP-ValueListItem] checked][FMP-ValueListItem] [/FMP-VALUELIST] [/select] Even if I set the select code so the first value is "- No Selection -", the problem persists. Anyone have a solution?
July 10, 200322 yr I've just tried this: <body> <form action="http://localhost:1154/FMPro" method="POST"> <input type="hidden" name="-db" value="combotest.fp5"> <input type="hidden" name="-lay" value="web"> <input type="hidden" name="-format" value="views.html"> Sport2: <select name="sport2"> <option value="- No Selection -">- No Selection -</option> [FMP-ValueList: sport2, List=sport2] <option value="[FMP-ValueListItem]">[FMP-ValueListItem]</option> [/FMP-ValueList] </select> <input type="submit" name="-new" value="New Record"> </form> </body> With the same restrictions, i.e.: "Not Empty" "Member of Value List Sport2" "Strict...." I receive an error if I select "- No Selection -". Good Luck Garry
July 10, 200322 yr Author Thanks, Garry. That was the solution! One more question: Is there an "include" code in the FMP web server akin to the <!--#include: xxxxxxx--> statement in Apache?
July 10, 200322 yr Yes there is an "Include". Here is an example from the "CDML Reference" database: [FMP-If: CurrentError .eq. 509] [FMP-Include: requirefield.htm] [FMP-Else] [FMP-Include: othererror.htm] [/FMP-If] All the best. Garry
July 11, 200322 yr "[select name="Assigned" size=4]" "...akin to the <!--#include: xxxxxxx--> statement in Apache?" The brackets of this line, and the "include...Apache" query suggest to me that someone needs to get (and read) the CDML Reference Database to make their life as a developer easier. Links can be found by searching that string in the CDML forums. Good luck
July 12, 200322 yr Seeing that the CDML [FMP-If] tags are not working properly within the Select tags Javascript will need to be used. Here is a Javascript example: <body> <form action="http://localhost:1154/FMPro" method="POST"> <input type="hidden" name="-db" value="combotest.fp5"> <input type="hidden" name="-lay" value="web"> <input type="hidden" name="-format" value="views.html"> Country: <select name="Countries"> <script>myglobal = "[FMP-Field: g_Countries]"; [FMP-ValueList: Countries, List=Countries] if ( myglobal == "[FMP-ValueListItem]") { document.write('<option value="[FMP-ValueListItem]" selected>[FMP-ValueListItem]</option>'); } else { document.write('<option value="[FMP-ValueListItem]">[FMP-ValueListItem]</option>'); }; [/FMP-ValueList] </script> </select> <input type="submit" name="-new" value="New Record"> </form> </body> Hope this helps. Garry
Create an account or sign in to comment