You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by an...@wipro.com on 2004/07/22 05:33:25 UTC

Validation Error Alert

Hi,



I get an alert on clicking the exclamation mark in a form, when there is
a validation error for a required field widget. The alert has a message
general.field-required. Is it possible that I can change this alert
message.

I want this error message only for required fields. The other places I
would have the error message that I set in the setValidationError("Error
Message") method.

I tried tweaking the forms-field-styling.xsl and added the following
code snippet there : -

    <xsl:choose>

    <xsl:when test="@required='true'">

      <a href="#" class="forms-validation-message"
onclick="alert('Mandatory field , should not be left blank');return
false;">&#160;!&#160;</a>

    </xsl:when>

    <xsl:otherwise>

      <a href="#" class="forms-validation-message"
onclick="alert('{normalize-space(.)}');return false;">&#160;!&#160;</a>

    </xsl:otherwise>

    </xsl:choose>

  </xsl:template>



Still this does not work . Can someone suggest me where I could be
wrong. Also, is this the right approach for having our own custom error
message.



Regards,

Anand.








Confidentiality Notice

The information contained in this electronic message and any attachments to this message are intended
for the exclusive use of the addressee(s) and may contain confidential or privileged information. If
you are not the intended recipient, please notify the sender at Wipro or Mailadmin@wipro.com immediately
and destroy all copies of this message and any attachments.

Re: Validation Error Alert

Posted by Joose Vettenranta <jo...@iki.fi>.
Hi.

Use I18N-transformer to change the name of the field.

Look into samples/block/forms/messages/ -directory and 
samples/block/forms/sitemap.xmap for how to use it.

- Joose

22.7.2004 kello 06:33, <an...@wipro.com> kirjoitti:

> I get an alert on clicking the exclamation mark in a form, when there 
> is a validation error for a required field widget. The alert has a 
> message general.field-required. Is it possible that I can change this 
> alert message.
--
"Always remember that you are unique, just like everyone else!"
* http://iki.fi/joose/ * joose@iki.fi * +358 44 561 0270 *


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