Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var x = 1;
- function getSupplier( manID ){
- new Ajax.Request("addField.php",
- {
- method: 'post',
- postBody: 'manID='+ manID,
- onSuccess: function(transport){
- var response = transport.responseText || "no response text";
- alert("Success! \n\n" + response);
- },
- });
- }
- function addInput(){
- x++;
- manID = document.getElementById("manID").value
- getSupplier( manID );
- eDIV = document.createElement("div");
- eDIV2 = document.createElement("div");
- eDIV.setAttribute("id","fieldWrapper");
- eDIV2.setAttribute("id","inputDesc");
- eAnchor = document.createElement("input"); //create the input box
- eAnchor.setAttribute("type", "text"); //assign the input box a type
- eAnchor.setAttribute("value", getSupplier.responseText);
- eAnchor.setAttribute("name", "discount" + x); //asign a reference to the input box
- eDIV.appendChild(eAnchor); //append the input to the div
- document.getElementById("fields").appendChild(eDIV); //insert the new div into existing one
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement