1 Reply Latest reply on May 9, 2007 9:18 PM by HyderAlamgir

    Finding simple form so dificult

      Hi all. Been struggling with a form for hours now. I just don't seem to be able to understand how it works, or doesn't!
      I cannot find anything on the net on how to create a form without the tutorials using datagrids.
      I thought datagrids were for displaying data which I don't want. Just want to send data to a php page.

      My problem is the submit button will not work. Any help greatfully accepted. My code below

      <?xml version="1.0" encoding="utf-8"?>
      <mx:Application xmlns:mx=" http://www.adobe.com/2006/mxml" creationComplete="send_data()">
      private function send_data():void {

      <mx:Array id="towns">
      <mx:Object label="Axminster" data="axminster" />
      <mx:Object label="Beaminster" data="beaminster" />
      <mx:Object label="Bridport" data="bridport" />
      <mx:Array id="trades">
      <mx:Object label="Aerial Installers" data="Aerial Installers" />
      <mx:Object label="Designers" data="Designers" />
      <mx:Object label="Hairdressers" data="Hairdressers" />

      <mx:Canvas width="100%" height="100%">
      <mx:Form width="100%" height="100%" backgroundColor="#ffffff">
      <mx:Label text="Which area or town is closest to you?" fontWeight="bold"> </mx:Label>
      <mx:ComboBox id="town" dataProvider="{towns}">

      <mx:Label text ="What is your main trade ?" fontWeight="bold"/>
      <mx:ComboBox id="trade" dataProvider="{trades}"> </mx:ComboBox>
      <mx:Label text="Company name?" fontWeight="bold"/>
      <mx:TextInput width="278" height="25" id="company_name" borderStyle="inset" backgroundColor="#ffff80"/>

      <mx:Label text="Heading you want displayed on the page ?" fontWeight="bold"/>
      <mx:TextInput x="279" y="112" width="429" backgroundColor="#ffff80" id="heading"/>
      <mx:Label text="Description" fontWeight="bold"/>
      <mx:RichTextEditor x="168" y="160" width="528" height="248" id="main_text">
      <mx:Label text="Address" fontWeight="bold"/>
      <mx:TextArea x="168" y="436" width="359" height="53" id="address"/>
      <mx:Label text="Postcode" fontWeight="bold"/>
      <mx:TextInput x="168" y="514" id="postcode"/>
      <mx:Label text="Website Address" fontWeight="bold"/>
      <mx:TextInput x="168" y="555" width="248"/>

      <mx:Button label="Submit" click="send_data()"/>

      <mx:HTTPService id="userRequest" url="flex.php" useProxy="false" method="POST">
      <mx:request xmlns="">
        • 1. Re: Finding simple form so dificult
          HyderAlamgir Level 1
          First off, correct this.... {trades} => {trade}

          <mx:ComboBox id="trade" dataProvider="{trades}"> </mx:ComboBox>

          Then, post the PHP file. It might help

          Also keep in mind that you need a PHP server like Appache to parse the PHP file. If you don't know about it, let us know. I'm new to all of this as well. Learned it the hard way, hope I can help you.