3 Replies Latest reply on May 13, 2009 6:55 AM by chandler124

    Validation Button in a form

    chandler124 Level 1



      I made a virgin form, the user should fill the blanks by a Name, Adress, Phone number ... And I want to make a "OK" button in order to validate the form and to add this record to a 4D database. The connection between the Flex appli and the 4D DB is on. How can I proceed to make this script please?


      Thank you

        • 1. Re: Validation Button in a form
          Michael Borbor Level 4

          You can see this example over here




          You need to learn about validators so you can use them, and also make sure to validate data on the server too.

          1 person found this helpful
          • 3. Re: Validation Button in a form
            chandler124 Level 1

            Sorry if I ask the same question (again) but I don't understand how to add the datas returned by the user. Here's my panel's code which is supposed to recover user's datas :




            <mx:Panel layout="vertical" color="0xffffff" borderAlpha="0.15" paddingTop="10" paddingRight="10" paddingBottom="10" paddingLeft="10" horizontalAlign="center" y="77" width="868" height="588" horizontalCenter="0">

                     <mx:Form color="0x323232" width="823" height="518">

                        <mx:Text width="100%" text=""/>


                        <mx:FormItem label="Name: " required="true">

                            <mx:TextInput id="fname" width="580"/>



                        <mx:FormItem label="Code :" required="false">

                            <mx:TextInput id="email" width="580"/>


                        <mx:FormItem label="Statut :" required="false">



                        <mx:FormItem label="Secteur d'activitŽ :" required="false">

                            <mx:TextInput id="email0" width="580"/>


                        <mx:FormItem label="Groupe :" required="false">

                            <mx:TextInput id="email1" width="580"/>


                        <mx:FormItem label="Adresse :" required="false">

                            <mx:TextInput id="email2" width="580"/>


                        <mx:FormItem label="Ville :" required="false">

                            <mx:TextInput id="email3" width="580"/>


                        <mx:FormItem label="Code postal :" required="false">

                            <mx:TextInput id="email4" width="580"/>


                        <mx:FormItem label="TŽlŽphone :" required="false">

                            <mx:TextInput id="email9" width="580"/>


                        <mx:FormItem label="Email :" required="false">

                            <mx:TextInput id="email10" width="580"/>


                        <mx:FormItem label="Responsable commercial :" required="false">

                            <mx:TextInput id="email5" width="580"/>


                        <mx:FormItem label="Responsable production :" required="false">

                            <mx:TextInput id="email6" width="580"/>


                        <mx:FormItem label="Autre responsable (3) :" required="false">

                            <mx:TextInput id="email7" width="580"/>


                        <mx:FormItem label="Autre responsable (4) :" required="false">

                            <mx:TextInput id="email8" width="580"/>


                        <mx:Button id="submitButton" enabled="false"

                            label="OK" click="submitForm();" textDecoration="underline" width="72"/>

                        <mx:Button label="Annuler" click="currentState=''"/>




            <mx:RemoveChild target="{contacts_dg}"/>

            <mx:RemoveChild target="{combobox1}"/>

            <mx:RemoveChild target="{combobox4}"/>

            <mx:RemoveChild target="{text2}"/>

            <mx:RemoveChild target="{text1}"/>

            <mx:RemoveChild target="{text12}"/>

            <mx:RemoveChild target="{combobox2}"/>

            <mx:RemoveChild target="{combobox3}"/>

            <mx:RemoveChild target="{text3}"/>

            <mx:RemoveChild target="{text4}"/>

            <mx:RemoveChild target="{cpArea}"/>

            <mx:RemoveChild target="{adresseArea}"/>

            <mx:RemoveChild target="{villeArea}"/>

            <mx:RemoveChild target="{groupeArea}"/>

            <mx:RemoveChild target="{text5}"/>

            <mx:RemoveChild target="{text6}"/>

            <mx:RemoveChild target="{radiobutton1}"/>

            <mx:RemoveChild target="{radiobutton2}"/>

            <mx:RemoveChild target="{secteurArea}"/>

            <mx:RemoveChild target="{text7}"/>

            <mx:RemoveChild target="{text10}"/>

            <mx:RemoveChild target="{nomArea}"/>

            <mx:RemoveChild target="{codeArea}"/>

            <mx:RemoveChild target="{text8}"/>

            <mx:RemoveChild target="{text11}"/>

            <mx:RemoveChild target="{text9}"/>

            <mx:RemoveChild target="{btnSupprimer}"/>

            <mx:RemoveChild target="{btnModifier}"/>

            <mx:RemoveChild target="{btnAjouter}"/>




            Actually, my Validator works but now the problem is to integrate into the database ... and thank you for those examples which helped me