Rev 5048 | Rev 5053 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed
<%@LANGUAGE="VBSCRIPT"%><%' sdk_names_new.asp' This file is designed to be injected (loaded) into a 'div' on a window' It is a pop up dialog%><script>$( "#f1" ).dialog({autoOpen: true,width: 500,modal: true,draggable: true,resizable: true,dialogClass: "rounded_box",buttons: [{text : 'Add',class : 'hideOnError',click : function(){clearInfo();$( "#f1" ).submit();},},{text : 'Cancel',click : function(){$( this ).dialog( "close" );},},],open: function( event, ui ) {},close : function(event, ui ){// Need to remove DOM elements on close so that// When it is opened again - the binds occur correctly$(this).dialog('destroy').remove();},});function setInfo(txt) {$("#info").text( txt).addClass("error");}function clearInfo(txt) {$("#info").text("").removeClass("error");}$.validate({form: '#f1',validateOnBlur : false,onSuccess : function(f) {processSdkForm(f);},});// Severe Error processing// Disable all the inputs on a form// Hide dialog buttons marked to be hidden// All the user can do is read the erro message and close the formfunction disableForm(){var form = $("#f1");form.dialog( "widget" ).find(".hideOnError").hide();form.find(":input").prop("disabled",true);}function processSdkForm(f){clearInfo();$("#progressBar").css('visibility', 'visible');var postData = f.serializeArray();var formURL = f.attr("action");$.ajax({url : formURL,type: "POST",data : postData,dataType : "json",cache: false,success:function(data, textStatus, jqXHR){//data: return data from server//console.log ("UpdateData", data);if (data.result != 0){setInfo("Error:" + ((data.error != 0) ? data.emsgSummary : "Reason not given"));if (data.error >= 0) disableForm();return;}$("#sdk_version").trigger('sdkNameEdited');f.dialog( "close" );},error: function(jqXHR, textStatus, errorThrown){setInfo("Error:" + errorThrown);disableForm();//if fails},complete : function(){$("#progressBar").css('visibility', 'hidden');}});};$( "#f1" ).submit(function(e) {e.preventDefault(); //STOP default actionreturn false;});//# sourceURL=sdk_names_new.asp</script><form title="Add New SDK Family" id=f1 action="sdk_opr_json.asp" class=td><div id="info"></div><DIV id='progressBar' style='visibility:hidden;'><img src='icons/i_processing.gif' width='79' height='14'></DIV><p><label for="sdkName">SDK Name:</label><br><input id=sdk_name type="text" name="sdkName" maxlength=50 size=40 data-validation="length" data-validation-length="min4"><p>Comment:<br><textarea id=sdk_comment name="sdkComment" cols=40 data-validation="length" data-validation-length="5-4000"></textarea><input type="hidden" name="action" value="addNew"></form>