gtorino Posted July 9, 2003 Posted July 9, 2003 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?
Anatoli Posted July 9, 2003 Posted July 9, 2003 You should check the input fields with JavaScript before submit is made.
Garry Claridge Posted July 10, 2003 Posted July 10, 2003 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
gtorino Posted July 10, 2003 Author Posted July 10, 2003 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?
Garry Claridge Posted July 10, 2003 Posted July 10, 2003 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
Unable Posted July 11, 2003 Posted July 11, 2003 "[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
Garry Claridge Posted July 12, 2003 Posted July 12, 2003 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
Recommended Posts
This topic is 8148 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now