Loading ...
Sorry, an error occurred while loading the content.
 

Re: [ydn-javascript] How to save in a Database?

Expand Messages
  • Satyam
    Use the Connection Manager. The auxiliary form you are using to do the submittal will end producing a POST document like 10=0&11=1& .... and so on. You don t
    Message 1 of 3 , Nov 4, 2008
      Use the Connection Manager. The auxiliary form you are using to do the
      submittal will end producing a POST document like 10=0&11=1& .... and so
      on. You don't need to use a form to assemble such a message, simply
      chain it like in a regular string, making sure to use encodeURIComponent
      (or escape) on each value and use it as the fourth argument in the call
      to asyncRequest.

      See:

      http://developer.yahoo.com/yui/examples/connection/post.html

      Satyam


      mbarnick67 wrote:
      > i am testing
      > http://developer.yahoo.com/yui/examples/dragdrop/dd-reorder.html
      > it is exact what i want.
      >
      > But only one Problem:
      > i have to save the two colums (each row) in a database and later -
      > load from the database.
      >
      > how can i do that?
      > i tried someting like this:
      >
      > a) in the html part:
      > <form name="f" id="f" method="post">
      > <input type="text" value="0" name="l0" />
      > <input type="text" value="1" name="l1" />
      > <input type="text" value="2" name="l2" />
      > <input type="text" value="3" name="l3" />
      > <input type="text" value="4" name="l4" />
      > <input type="text" value="5" name="l5" />
      > </form>
      >
      > b) in the init-function:
      > if (!document.f.l0.value) document.f.l0.value = 0;
      > if (!document.f.l1.value) document.f.l1.value = 0;
      > if (!document.f.l2.value) document.f.l2.value = 0;
      > if (!document.f.l3.value) document.f.l3.value = 0;
      > if (!document.f.l4.value) document.f.l4.value = 0;
      > if (!document.f.l5.value) document.f.l5.value = 0;
      >
      > c) in showOrder:
      > var ul1=Dom.get("ul1"), ul2=Dom.get("ul2");
      > alert(parseList(ul1, "List 1") + "\n" + parseList(ul2, "List 2"));
      >
      > var items = ul1.getElementsByTagName("li");
      > document.f.l0.value = items[0].id;
      > document.f.l1.value = items[1].id;
      > document.f.l2.value = items[2].id;
      >
      > var items = ul2.getElementsByTagName("li");
      > document.f.l3.value = items[3].id;
      > document.f.l4.value = items[4].id;
      > document.f.l5.value = items[5].id;
      >
      > i have to know the length of ul1 and ul2 too ... but here i haven't them
      >
      > then i want to make an document.f.submit() and write the values in a
      > database.
      >
      > But it doesn't work :-((( Something goes wrong and i don't know what
      > and why.
      >
      > what can i do do transfer the values in a database?
      >
      > you can answer in german if you can.
      > thanks very much
      >
      >
      >
      > ------------------------------------
      >
      > Yahoo! Groups Links
      >
      >
      >
      > ------------------------------------------------------------------------
      >
      >
      > No virus found in this incoming message.
      > Checked by AVG - http://www.avg.com
      > Version: 8.0.175 / Virus Database: 270.8.5/1764 - Release Date: 03/11/2008 7:46
      >
      >
    Your message has been successfully submitted and would be delivered to recipients shortly.