|
From: <sv...@de...> - 2005-06-03 14:37:02
|
Author: pcamacho
Date: 2005-06-03 10:36:52 -0400 (Fri, 03 Jun 2005)
New Revision: 1236
Modified:
humano2/trunk/web/portal/site/js/commonfunctions.js
humano2/trunk/web/portal/site/readXslt.aspx
Log:
FIX: bug #156. When pressing enter, we only submitted the form without do=
ing any checks... The target of form has=20
been put in html code (readXslt.aspx).
Modified: humano2/trunk/web/portal/site/js/commonfunctions.js
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- humano2/trunk/web/portal/site/js/commonfunctions.js 2005-06-02 23:26:=
52 UTC (rev 1235)
+++ humano2/trunk/web/portal/site/js/commonfunctions.js 2005-06-03 14:36:=
52 UTC (rev 1236)
@@ -1,3 +1,4 @@
+//FIXME I think I'm unuseful... Could you check and delete me?
function fn_doCheckValidString(strCheck)
{
var chrArray =3D " abcdefghijklmn?opqrstuvwxyzABCDEFGHIJKLMN?OPQRSTUVWX=
YZ.,;:-_{}()??!\\/=3D+*#$%&\n\r0123456789";
@@ -32,6 +33,8 @@
{
return str.replace(/^\s*|\s*$/g,"");
}
+
+//FIXME I think I'm unuseful... Could you check and delete me?
/*
*Obtain object array with all element's of some type, in especific tag
*/
@@ -51,6 +54,7 @@
}
return myArr;
}
+
/**
* Check every attributes: if one is incorrect, then raise an alert,
* put its name color to red, and do not submit
@@ -102,37 +106,50 @@
return formOk;
}
=20
-function saveInstance()
+
+/**
+ * Check the form before sending it
+ * @param enterPressed to know if the form has been sent by pressing ent=
er of clicking on "Save" button
+ * @return true if the check is ok, false if not (in this case the form =
is obviously not submitted)
+ */
+function saveInstance(enterPressed)
{
if(!checkForm())
- return;
+ {
+ return false;
+ }
=09
- document.MainForm.target=3D"mainFrame" =20
- document.MainForm.submit()
+ if(enterPressed !=3D true) //Button pressed
+ {
+ document.MainForm.submit();
+ }
+ else
+ {
+ return true; //Enter key was pressed =3D> so the form is automat=
ically sumbited =20
+ }
}
=20
-
-function ChangeBlockReclamo(objTab,ClassFrom,ClassTo,IdEntityFrom){
-var StrTables
-var StrTab,StrTabShort
- StrTables =3D document.getElementsByTagName('TABLE')
- for(i=3D0; i<StrTables.length;i++){
- if(StrTables[i].id!=3D''){
- StrTab =3D StrTables[i].id
- StrTabShort =3D StrTab.substr(0, 3)
- if(StrTabShort=3D=3D'Tab'){
- StrTables[i].className =3D "A-page3"
- }
- =09
- }=09
- }
-
-objTab.className =3D "A-page4"
-
-
-//document.frames['IframeObjRel'].location.href=3D"nothing.htm?classId=3D=
"+classId+"&IdEntity=3D"+IdEntity
-document.all.IframeObjRel.src=3D"viewrelations.aspx?ClassFrom=3D"+ClassF=
rom+"&Classto=3D"+ClassTo+"&IdEntityFrom=3D"+IdEntityFrom
-
+//FIXME : document me please
+function ChangeBlockReclamo(objTab,ClassFrom,ClassTo,IdEntityFrom)
+{
+ var StrTables;
+ var StrTab,StrTabShort;
+ StrTables =3D document.getElementsByTagName('TABLE');
+ for(i=3D0; i<StrTables.length;i++)
+ {
+ if(StrTables[i].id!=3D'')
+ {
+ StrTab =3D StrTables[i].id
+ StrTabShort =3D StrTab.substr(0, 3)
+ if(StrTabShort=3D=3D'Tab')
+ {
+ StrTables[i].className =3D "A-page3"
+ }
+ }=09
+ }
+ objTab.className =3D "A-page4"
+ //document.frames['IframeObjRel'].location.href=3D"nothing.htm?class=
Id=3D"+classId+"&IdEntity=3D"+IdEntity
+ document.all.IframeObjRel.src=3D"viewrelations.aspx?ClassFrom=3D"+Cl=
assFrom+"&Classto=3D"+ClassTo+"&IdEntityFrom=3D"+IdEntityFrom
}
=20
=20
Modified: humano2/trunk/web/portal/site/readXslt.aspx
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- humano2/trunk/web/portal/site/readXslt.aspx 2005-06-02 23:26:52 UTC (=
rev 1235)
+++ humano2/trunk/web/portal/site/readXslt.aspx 2005-06-03 14:36:52 UTC (=
rev 1236)
@@ -45,8 +45,8 @@
}
</script>
</head>
- <body style=3D"MARGIN: 10px" text=3D"#000000" vLink=3D"#000=
000" aLink=3D"#000000" link=3D"#000000" bgColor=3D"#ffffff">
- <form method=3D"POST" name=3D"MainForm" enctype=3D"multi=
part/form-data">
+ <body style=3D"MARGIN: 10px" text=3D"#000000" vLink=3D"#000=
000" aLink=3D"#000000" link=3D"#000000" bgColor=3D"#ffffff" >
+ <form method=3D"POST" name=3D"MainForm" enctype=3D"multi=
part/form-data" target=3D"mainFrame" onsubmit=3D"return saveInstance(true=
)">
<xsl:attribute name=3D"action">
<xsl:if test=3D"/page/flagaction=3D'Create'">
<xsl:value-of select=3D"/page/action/create"=
/>
|