KendoUI Survey For Rollbase Script
<script> | |
function callback(arr) { | |
for (var k=0; k<arr.length; k++) { | |
alert("===>" + arr[k]); | |
}} | |
var viewModel = kendo.observable({ | |
name: "", | |
designation: "", | |
company: "", | |
telephone: "", | |
workEmail: "", | |
eventAttended: null, | |
primaryBusiness: "", | |
customerIndustry: [], | |
role: [], | |
priorities: [], | |
initiatives: [], | |
surveySubmitted: false, | |
interests: [], | |
contactTime:null, | |
partnerInterest: null, | |
submit: function (e) { | |
e.preventDefault(); | |
var validator = $("#frmSurvey").kendoValidator().data("kendoValidator"); | |
if (validator.validate()) { | |
console.log(this) | |
var x = new Array(); | |
x["FullName_Survey"] = this.get("name"); | |
x["Work_Email_XSurvey2"] = this.get("workEmail"); | |
x["Company_Name"] = this.get("company"); | |
x["Attend_Event"] = this.get("eventAttended"); | |
x["Contact_Timeframe"] = this.get("contactTime"); | |
x["Customer_Industry"] = this.get("customerIndustry").join(); | |
x["Designation_XSurvey2"] = this.get("designation"); | |
x["Initiatives_Focus"] = this.get("initiatives").join(); | |
x["key_Priorities_"] = this.get("priorities").join(); | |
x["Nature_of_Business"] = this.get("primaryBusiness"); | |
x["Progress_Partnership"] = this.get("partnerInterest"); | |
x["Progress_Solutions"] = this.get("interests").join(); | |
x["Role"] = this.get("role").join(); | |
x["Work_Phone_No_X"] = this.get("telephone") | |
rbf_createRecord("SurveyXQuestions", x , false, callback); | |
var callback2 = function(errMsg, apiName) { | |
alert("ERROR: "+errMsg+" in: "+apiName); | |
}; | |
rbf_setErrorsCallback(callback2); | |
this.set("surveySubmitted", true); | |
} | |
} | |
}) | |
kendo.bind(document.body, viewModel) | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment