tab1.js 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. function validateSyncForm()
  2. {
  3. document.getElementById("fsync-datatype-error").style.display = "none";
  4. document.getElementById("fsync-authform-error").style.display = "none";
  5. if(document.getElementById("fsync_datatype").value == '')
  6. {
  7. document.getElementById("fsync-datatype-error").style.display = "block";
  8. return false;
  9. }
  10. if(
  11. document.getElementById("fsync_auth_apikey").value == '' ||
  12. document.getElementById("fsync_auth_username").value == '' ||
  13. document.getElementById("fsync_auth_password").value == '' ||
  14. document.getElementById("fsync_auth_fiscalcode").value == ''
  15. )
  16. {
  17. document.getElementById("fsync-authform-error").style.display = "block";
  18. return false;
  19. }
  20. return true;
  21. }
  22. function submitSyncForm()
  23. {
  24. if(validateSyncForm())
  25. {
  26. document.getElementById('btn_sync_form').disabled = true;
  27. var alertboxes = document.getElementsByClassName("alert-box");
  28. for (var i = 0, length = alertboxes.length; i < length; i++) {
  29. alertboxes[i].style.display = "none";
  30. }
  31. document.getElementById("alert-sync").style.display = "block";
  32. document.getElementById('sync_form').submit();
  33. }
  34. }