1. /* Add/Edit Certificate */
  2. $("form#certForm").live('submit',function() {
  3. if($("#certForm").valid() == false) return false;
  4. var options = {
  5. type: "post",
  6. url: "ajax-servers/table-form.php",
  7. success: function(data) {
  8. var expTblRow = data;
  9. $('#certForm').clearForm();
  10. if($('#cert_id').val()!='') {
  11. var expId = $('#cert_id').val();
  12. $('#delcert'+expId).replaceWith(expTblRow);
  13. } else {
  14. $('#certTbl td.dataTables_empty').parent().html('');
  15. $(expTblRow).appendTo("#certTbl tbody");
  16. }
  17. runEffect('#dialogcert');
  18. }
  19. };
  20.  
  21. $('#certForm').ajaxSubmit(options);
  22. return false;
  23. });
  24.