struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Anderson, James H [IT]" <james.h.ander...@citigroup.com>
Subject client-side validation not working
Date Fri, 13 Feb 2004 14:23:44 GMT
Server-side validation is working fine, but I can't seem to get client-side working.

I know I must be doing something wrong, but I can't figure out what it is :-(

Here's a bit of the tile that uses validation:

<%@ taglib uri="/tags/struts-bean" prefix="bean" %>
<%@ taglib uri="/tags/struts-html" prefix="html" %>
<%@ taglib uri="/tags/struts-logic" prefix="logic" %>

<html:form action="/SelectActivity" onsubmit="return validateActivityViewForm(this)">
    <TABLE border="0" cellspacing="0" cellpadding="0" align="center"> 
...
          <html:text property="starting" value="" size="10"/>
...
          <html:text property="ending" value="" size="10"/>
...
     <logic:messagesPresent>
        <html:messages id="error">
          <TR><TD><FONT color="red"><STRONG><bean:write name="error"/></STRONG></FONT><TD><TR>
        </html:messages>
      </logic:messagesPresent>
    </TABLE>
</html:form>
<html:javascript formName="ActivityViewForm"/>

Here's the piece of validation.xml:

    <formset>

      <form name="ActivityViewForm">
        <field
           property="starting"
           depends="date">
          <arg0 key="ActivityViewForm.starting.displayname"/>
        </field>
        <field
           property="ending"
           depends="date">
          <arg0 key="ActivityViewForm.ending.displayname"/>
        </field>
      </form>
      
    </formset>

Here's the Action entry from struts-config:

    <action
       path="/SelectActivity"
       name="ActivityViewForm"
       type="portfolio.SelectActivityAction"
       input=".activity.detail"/>


ActivityViewForm extends PortfolioForm which is declared thusly:

public class PortfolioForm extends ValidatorForm implements Serializable {

As I said, server-side validation is working fine, but the javascript on the client-side isn't
getting activated.

I hope someone can help me to resolve this quickly!

Thanks very much,

jim




---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


Mime
View raw message