jhylands

Untitled

May 13th, 2014
342
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //function used to check all information is in a for that can be sent to the server so that no errors are returned. Data validation is also carryed out on the server
  2. function submitForVerification(){
  3.     strBuild="";
  4.     //put the elements array into a form that can be sent to the server
  5.     for(i=0;i<elements.length;i++){
  6.         //don't put a comma at the beggining but do put one in between each element
  7.         if(i==0){
  8.             strBuild = strBuild + elements[i].title;
  9.         }else{
  10.             strBuild = strBuild + "," + elements[i].title;
  11.         }
  12.     }
  13.     //write into the form
  14.     var formToBeWrittenTo = document.getElementById('headings')
  15.     formToBeWrittenTo.value = strBuild;
  16.     strBuild="";
  17.     for(i=0;i<elements.length;i++){
  18.         //don't put a comma at the beggining but do put one in between each element
  19.         if(i==0){
  20.             strBuild = strBuild + elements[i].type;
  21.         }else{
  22.             strBuild = strBuild + "," + elements[i].type;
  23.         }
  24.     }
  25.     formToBeWrittenTo = document.getElementById('columnsToGo')
  26.     formToBeWrittenTo.value = strBuild;
  27.     //submit to form to the server
  28.     document.formSubmit.submit();
  29. }
Advertisement
Add Comment
Please, Sign In to add comment