Advertisement
Guest User

Untitled

a guest
Jun 28th, 2017
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.     var x = 1;
  2.     function getSupplier( manID ){
  3.         new Ajax.Request("addField.php",
  4.                     {
  5.                     method: 'post',
  6.                     postBody: 'manID='+ manID,
  7.                     });
  8.         }
  9.         function addInput(){
  10.         x++;
  11.             manID = document.getElementById("manID").value
  12.             getSupplier( manID );
  13.             eDIV = document.createElement("div");
  14.             eDIV2 = document.createElement("div");
  15.             eDIV.setAttribute("id","fieldWrapper");
  16.             eDIV2.setAttribute("id","inputDesc");                              
  17.             eAnchor = document.createElement("input");                          //create the input box
  18.             eAnchor.setAttribute("type", "text");                                           //assign the input box a type
  19.             eAnchor.setAttribute("value", getSupplier.responseText);
  20.             eAnchor.setAttribute("name", "discount" + x);               //asign a reference to the input box
  21.             eDIV.appendChild(eAnchor);                                                          //append the input to the div
  22.             document.getElementById("fields").appendChild(eDIV);        //insert the new div into existing one
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement