creating a new list item from a form created in HTML-tried something different

Sep 15, 2014 at 7:06 PM
Here is my Java code, I tried something different. It says it is completed but when I go to my list the new item isn't there, Any suggestions?

<html>
<head>
<script language="javascript" type="text/javascript" src="http://portal.bizerba.com/Javascript/jquery-1.11.0.min.js"></script>
<script language="javascript" type="text/javascript" src="http://portal.bizerba.com/Javascript/jquery.SPServices-2014.01.min.js"></script>
<script language="JavaScript"> // Define a function for later use function print_todays_date( ) { var date = new Date( ); // Get today's date and time document.write(date.toLocaleString( )); // Insert it into the document } </script> <script type="text/javascript" language="javascript">

function CreateNewItem(name, displayDate, department, email, isRequested, rootCause, priority, version,
subject, detailDescrip) {
var siteUrl = 'https://teams.bizerba.com/sites/technik/technischebereiche/industrie/BVS/;

$().SPServices({
    operation: "UpdateListItems",
    webURL: siteUrl,
    async: false,
    batchCmd: "New",
    listName: "BVS_Change_Request",
    valuepairs: [["Title", subject], ["Name", name],["Date", displayDate], ["Department", department],
    ["E-mail", email], ["Is Requested", isRequested],["Root Cause", rootCause], ["Priority", priority],
    ["Material number or Version of the program", version],["Subject", subject],["Detail Description", detailDescrip]],
    completefunc: function(xData, Status) {
      alert("completed " + JSON.stringify(Status));
    }

}).fail( function() { alert("Failed") });
}
function validateForm() {
var name = document.forms["myForm"]["name"].value;
var department = document.forms["myForm"]["department"].value;
var email = document.forms["myForm"]["email"].value;
var changeRequest = document.getElementById("change").checked;
var techRequest = document.getElementById("technical").checked;
var extRequest = document.getElementById("extension").checked;
var investRequest = document.getElementById("investigation").checked;
var complaintCause = document.getElementById("complaint").checked;
var marketCause = document.getElementById("market").checked;
var cipCause = document.getElementById("cip").checked;
var bugCause = document.getElementById("bug").checked;
var legalCause = document.getElementById("legal").checked;
var investCause = document.getElementById("invest").checked;
var changeCause = document.getElementById("changefrom").checked;
var priority = document.getElementById("dropdownID").value;
var version = document.forms["myForm"]["number"].value;
var subject = document.forms["myForm"]["subject"].value;
var detailDescrip = document.forms["myForm"]["detail"].value;
var displayDate = Date().toLocaleString();

if (name==null || name=="") {
    alert("First name must be filled out");
    return false;
}
if (department==null || department=="") {
    alert("Department name must be filled out");
    return false;
}
if (email==null || email=="") {
    alert("E-mail must be filled out");
    return false;
}
if (changeRequest == true){
    var isRequested = document.getElementById("change").value;
    }
    else if (techRequest == true){
    isRequested = document.getElementById("technical").value;
    }
    else if (extRequest == true){
    isRequested = document.getElementById("extension").value;
    }
    else if (investRequest == true){
    isRequested = document.getElementById("investigation").value;
    }
    else {
    alert("You must select a Is Requested");
    return false;
    }
if (complaintCause == true){
    var rootCause = document.getElementById("complaint").value;
    }
    else if (marketCause == true){
    rootCause = document.getElementById("market").value;
    }
    else if (cipCause == true){
    rootCause = document.getElementById("cip").value;
    }
    else if (bugCause == true){
    rootCause = document.getElementById("bug").value;
    }
    else if (legalCause == true){
    rootCause = document.getElementById("legal").value;
    }
    else if (investCause == true){
    rootCause = document.getElementById("invest").value;
    }
    else if (changeCause == true){
    rootCause = document.getElementById("changefrom").value;
    }
    else {
    alert("You must select a Root Cause");
    return false;
    }
if (version==null || version=="") {
    alert("You must enter a material number or version of the program");
    return false;
    }
if (subject==null || subject=="") {
    alert("You must enter a subject");
    return false;
    }
if (detailDescrip==null || detailDescrip=="") {
    alert("You must enter a detailed description");
    return false;
    }

alert("starting function call");
CreateNewItem(name, displayDate, department, email, isRequested, rootCause, priority, version, 
subject, detailDescrip);
alert("after function call");

}