2 Replies Latest reply on May 31, 2007 5:42 PM by Genos_Free

    returning to main state

    Genos_Free
      This is a silly one but I'm looking for a fast fix.
      If I submit a form and when I do I will go to another viewstate
      that states the form is submitted.
      I have a button on that state that with the click event i.e.
      <mx:FormItem id="formitem2">
      <mx:Button x="10" y="223" label="Send" click="muFuctionCall(event), currentState='submitted'" id="mySubmitButton"/>
      </mx:FormItem>

      I want to go back to the main state but thereis still text in the main states form fields.
      What do I do to get the foem fields cleared out so it looks like the original state.

      Thanks,
      Gene
        • 1. Re: returning to main state
          BLXWebMaster Level 1
          private function resetFields():void{
          cbActivity.selectedIndex = 0; // To Set ComboBoxes
          taComments.text = ''; // To Set Text Fields
          chkCompleted.selected=false; // To Set Check Boxes
          }

          Now just call resetFields(); from your muFuctionCall.
          • 2. Re: returning to main state
            Genos_Free Level 1
            This is what is did.
            private function resetFields(event:MouseEvent):void {
            subject.text = '';
            body.text = '';
            }

            <mx:Panel width="450" height="361" layout="absolute" title="Contact Us!" horizontalAlign="left" verticalAlign="top"
            fontFamily="Times New Roman" fontSize="16" color="#808000" themeColor="#808080" cornerRadius="13" borderColor="#808040" id="panel1">
            <mx:Form height="301" id="form1">
            <mx:TextInput id="email" x="62" width="247" bottom="220"/>
            </mx:FormItem> -->
            <mx:FormItem label="Subject:" x="1" y="48" fontSize="10">
            <mx:TextInput id="subject" x="62" width="247" bottom="181"/>
            </mx:FormItem>

            <mx:FormItem label="Message:" x="1" y="84" fontSize="10" id="formitem1">
            <mx:RichTextEditor id="body" x="10" y="117" height="200"/>
            </mx:FormItem>

            <mx:FormItem id="formitem2">
            <mx:Button x="10" y="223" label="Send" click="eMailer(event),
            currentState='sent', resetFields(event)" id="button1" fontSize="14"/>
            </mx:FormItem>

            </mx:Form>

            Thanks for the info.
            I feel siil.
            I just goes to show you how powerful action script is.
            Thanks dude/.