0 Replies Latest reply on Jul 15, 2011 1:58 PM by flashharry!

    sortable URLVariables to emulate Arrays in HTML Form Variables

    flashharry! Level 1

      HI,

       

      I need to create a flex form that post arrays back to a php server side script, I do not have access to the source of the php and its encoded

       

      When my data is sent its sent in random order

       

      Array
      (
          [SEARCHFIELD] => Array
              (
                  [0] => Array
                      (
                          [SELECTEDVOL] => 1
                          [LOGIC] => 0
                          [FIELDNAME] => SELECTEDVOL
                      )
      
                  [3] => Array
                      (
                          [dbsearchkeyword149] => photo
                          [dbsearchflag149] => -1
                          [logic] => 1
                          [dbsearchtype149] => 253
                      )
      
                  [1] => Array
                      (
                          [PATHTYPE] => 1
                          [LOGIC] => 0
                          [FIELDNAME] => PATHTYPE
                      )
      
                  [2] => Array
                      (
                          [LOGIC] => 1
                          [FILENAME] => photo
                          [PATHSEARCHTYPE] => -1
                          [FIELDNAME] => FILENAME
                      )
      
              )
      I need the SEARCHFIELD to be sent in order, it must be sent in order.

       

      There created in order via a loop

      var params = new URLVariables();

       

      params["SEARCHFIELD[" + i + "][FIELDNAME]"] = "FILENAME";

      params["SEARCHFIELD[" + i + "][PATHSEARCHTYPE]"] = tempLogic;

      params["SEARCHFIELD[" + i + "][FILENAME]"] = tempValue;

       

      etc.

       

      I need to sort params.SEARCHFIELD

       

      If I create the same data in html inputs it works, its received in the order its created.

       

      <input type="text" name="SEARCHFIELD[0][FIELDNAME]" value="" />

      <input type="text" name="SEARCHFIELD[0][PATHSEARCHTYPE]" value="" />

      <input type="text" name="SEARCHFIELD[0][FILENAME]" value="" />

       

      How can I post data as an array so its received in oder its created.

       

      I have tried an array but it comes over as object object

       

      tia

      harry