You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lenya.apache.org by gr...@apache.org on 2004/01/16 15:51:04 UTC

cvs commit: cocoon-lenya/src/webapp/lenya/xslt/info rename.xsl

gregor      2004/01/16 06:51:04

  Modified:    src/webapp/lenya/xslt/info rename.xsl
  Log:
  make it harder for users to shoot themselves in the foot. no more renames with spaces or / in the document id
  
  Revision  Changes    Path
  1.14      +24 -2     cocoon-lenya/src/webapp/lenya/xslt/info/rename.xsl
  
  Index: rename.xsl
  ===================================================================
  RCS file: /home/cvs/cocoon-lenya/src/webapp/lenya/xslt/info/rename.xsl,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- rename.xsl	8 Dec 2003 14:40:52 -0000	1.13
  +++ rename.xsl	16 Jan 2004 14:51:04 -0000	1.14
  @@ -35,7 +35,29 @@
       <div class="lenya-box">
         <div class="lenya-box-title">Rename Document</div>
         <div class="lenya-box-body">
  -        <form method="get">
  +        <script Language="JavaScript">
  +function validRequired(formField,fieldLabel)
  +{
  +	var result = true;
  +	
  +	if (formField.value.match(".*[\\s\\/]+.*"))
  +	{
  +		alert('Please enter a valid value for the "' + fieldLabel +'" field.');
  +		formField.focus();
  +		result = false;
  +	}
  +	
  +}
  +
  +function validateForm(theForm)
  +{
  +	if (!validRequired(theForm["properties.node.secdocumentid"],"New Document ID"))
  +		return false;
  +
  +	return true;
  +}
  +</script>
  +           <form method="get" onsubmit="return validateForm(this)">
             <xsl:attribute name="action"></xsl:attribute>
             <input type="hidden" name="task-id" value="{$task-id}"/>
             <xsl:call-template name="task-parameters">
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: lenya-cvs-unsubscribe@cocoon.apache.org
For additional commands, e-mail: lenya-cvs-help@cocoon.apache.org