You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by GEDA <ge...@romtelecom.ro> on 2007/06/13 08:34:17 UTC

ReferenceError: validateForm_createuser is not defined

Please help me. I don't really understand this debug message: ReferenceError:
validateForm_createuser is not defined. Here is the code:

   <s:form action="createuser.do" validate="true">
       <s:textfield label="Name" name="name" />
       <s:password label="Password" name="password" />
       <s:submit theme="ajax" targets="listauseri" />
    </s:form>

        <action name="createuser"
class="ro.romtelecom.test.action.UserAction" method="save">
            <result>/createUser.jsp</result>
        </action>

and the validation xml is named: UserAction-createuser-validation.xml and is
as follows:
<!DOCTYPE validators PUBLIC "-//OpenSymphony Group//XWork Validator
1.0.2//EN" "http://www.opensymphony.com/xwork/xwork-validator-1.0.2.dtd">

<validators>
    <field name="name">
        <field-validator type="requiredstring">
            <message>Trebuie sa introduceti un string!</message>
        </field-validator>
    </field>

    <field name="password">
        <field-validator type="requiredstring">
            <message>Trebuie sa introduceti un string!</message>
        </field-validator>
    </field>
</validators>

What's wrong with this picture ?
-- 
View this message in context: http://www.nabble.com/ReferenceError%3A-validateForm_createuser-is-not-defined-tf3912818.html#a11093545
Sent from the Struts - User mailing list archive at Nabble.com.


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


Re: ReferenceError: validateForm_createuser is not defined

Posted by Jeromy Evans <je...@blueskyminds.com.au>.
GEDA wrote:
>> I still get the same error. :-|
>>
>> I discovered that this is happening when the jsp page where the form is
>> located, is loaded into a div tag. Is it normal the validation not working
>> from a div tag?	
In 2.0.6 the javascript in your ajax-loaded section is automatically 
removed by dojo. This breaks ajax validation.

See this thread: 
http://www.nabble.com/Problem-in-Implementation-of-Struts2-Validation-framework-t3833079.html

and this issue:

https://issues.apache.org/struts/browse/WW-1766



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


Re: ReferenceError: validateForm_createuser is not defined

Posted by GEDA <ge...@romtelecom.ro>.
Anyone ?


GEDA wrote:
> 
> I still get the same error. :-|
> 
> I discovered that this is happening when the jsp page where the form is
> located, is loaded into a div tag. Is it normal the validation not working
> from a div tag?
> 
> 
> Jeromy Evans - Blue Sky Minds wrote:
>> 
>> GEDA wrote:
>>> Please help me. I don't really understand this debug message:
>>> ReferenceError:
>>> validateForm_createuser is not defined. Here is the code:
>>>
>>>    <s:form action="createuser.do" validate="true">
>>>        <s:textfield label="Name" name="name" />
>>>        <s:password label="Password" name="password" />
>>>        <s:submit theme="ajax" targets="listauseri" />
>>>     </s:form>
>>>
>>>         <action name="createuser"
>>>   
>> Your action name is "createuser", not "createuser.do".  The <s:form> tag 
>> creates the url for the form, appending .do or .action as appropriate. 
>> View the generated html to see it.  As the URL is incorrect you'll 
>> either get a 404 from the container or confuse the params or validation 
>> interceptor.
>> 
>> Try <s:form action="createuser" and it should find your validation file.
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> For additional commands, e-mail: user-help@struts.apache.org
>> 
>> 
>> 
> 
> 

-- 
View this message in context: http://www.nabble.com/ReferenceError%3A-validateForm_createuser-is-not-defined-tf3912818.html#a11096922
Sent from the Struts - User mailing list archive at Nabble.com.


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


Re: ReferenceError: validateForm_createuser is not defined

Posted by GEDA <ge...@romtelecom.ro>.
I still get the same error. :-|


Jeromy Evans - Blue Sky Minds wrote:
> 
> GEDA wrote:
>> Please help me. I don't really understand this debug message:
>> ReferenceError:
>> validateForm_createuser is not defined. Here is the code:
>>
>>    <s:form action="createuser.do" validate="true">
>>        <s:textfield label="Name" name="name" />
>>        <s:password label="Password" name="password" />
>>        <s:submit theme="ajax" targets="listauseri" />
>>     </s:form>
>>
>>         <action name="createuser"
>>   
> Your action name is "createuser", not "createuser.do".  The <s:form> tag 
> creates the url for the form, appending .do or .action as appropriate. 
> View the generated html to see it.  As the URL is incorrect you'll 
> either get a 404 from the container or confuse the params or validation 
> interceptor.
> 
> Try <s:form action="createuser" and it should find your validation file.
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/ReferenceError%3A-validateForm_createuser-is-not-defined-tf3912818.html#a11095242
Sent from the Struts - User mailing list archive at Nabble.com.


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


Re: ReferenceError: validateForm_createuser is not defined

Posted by Jeromy Evans <je...@blueskyminds.com.au>.
GEDA wrote:
> Please help me. I don't really understand this debug message: ReferenceError:
> validateForm_createuser is not defined. Here is the code:
>
>    <s:form action="createuser.do" validate="true">
>        <s:textfield label="Name" name="name" />
>        <s:password label="Password" name="password" />
>        <s:submit theme="ajax" targets="listauseri" />
>     </s:form>
>
>         <action name="createuser"
>   
Your action name is "createuser", not "createuser.do".  The <s:form> tag 
creates the url for the form, appending .do or .action as appropriate. 
View the generated html to see it.  As the URL is incorrect you'll 
either get a 404 from the container or confuse the params or validation 
interceptor.

Try <s:form action="createuser" and it should find your validation file.

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