File size: 2,047 Bytes
07c3cdd
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
<?xml version="1.0" encoding="UTF-8"?>
<dynaForm name="processes_New" width="600" labelWidth="115px" mode="edit" enableTemplate="1">
  <menuUser type="xmlmenu" xmlfile="processes/processes_NewOptions">
    <en/>
  </menuUser>
  <TITLE1 type="title" group="1">
    <en><![CDATA[Process Information]]></en>
  </TITLE1>
  <PRO_TITLE type="text" size="60" maxlength="255" defaultvalue="" required="0" group="1" dependentfields="" linkfield="" strto="" readonly="0" noshowingrid="0" readonlyingrid="0" totalizeable="0" sqlconnection="">
    <en><![CDATA[Title]]></en>
  </PRO_TITLE>
  <!-- <PRO_DESCRIPTION type="html"> -->
  <PRO_DESCRIPTION type="textarea" rows="7" cols="58">
    <en><![CDATA[Description]]></en>
  </PRO_DESCRIPTION>
  <PRO_CATEGORY type="dropdown">
SELECT CATEGORY_UID, CATEGORY_NAME FROM PROCESS_CATEGORY
<en><![CDATA[Process Category]]><option name=""><![CDATA[- None -]]></option></en>
</PRO_CATEGORY>
  <SUBMIT type="button" onclick="verifyProcessInformation(this.form);" group="1">
    <en><![CDATA[Save]]></en>
  </SUBMIT>
  <BTN_CANCEL type="button" onclick="cancel();">
    <en><![CDATA[Cancel]]></en>
  </BTN_CANCEL>
  <MESSAGE1 type="phpvariable"/>
  <JS type="javascript" replacetags="1">

document.onkeypress=function(e){
var esIE=(document.all);
var esNS=(document.layers);
tecla=(esIE) ? event.keyCode : e.which;
if(tecla==13){
	return false;
  }
}


var verifyProcessInformation = function(oForm){ 
  var nameProcess = getField('PRO_TITLE').value;
  reqName=ajax_function('processes_Save','lookForNameProcess','NAMEPROCESS='+encodeURIComponent(nameProcess),'POST') ;
  
  var oAux;
	var bContinue = true;
	oAux = oForm.elements['form[PRO_TITLE]'];
	if (oAux.value == '')
	{
		alert("@#MESSAGE1");
		oAux.focus();
		bContinue = false;
	} else {
	  if(reqName){
	  	//the process name exists then we can't save it
	  	alert(G_STRINGS.ID_EXIST_PROCESS);return false;
	  } else {
			if (bContinue)
			{
				oForm.submit();
			}	
	  }
  }
  //return false;
};

function cancel(){
    history.back();
}

</JS>
</dynaForm>