You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by chengas123 <be...@gmail.com> on 2007/10/23 23:25:38 UTC
Validation of Ajax Tags
Does anyone have any ideas on how the dojo ajax tags can be validated
(autocompleter, datetimepicker, etc.)? I was told this was fixed in 2.1,
which I am using, but I cannot get it to work. I'd like to make my
autocompleter required and have it validate the same as my other fields.
Can I validate its key? What I'd really like to do is have the following
autocompleter:
<sx:autocompleter label="Site" value="%{system.site.name}"
forceValidOption="true"
cssStyle="width:132px; height:18px; border:1px solid #7B9EBD"
name="site" required="true" href="%{siteList}"
loadOnTextChange="true" showDownArrow="false" dropdownWidth="300"
searchType="substring" />
And then have this in my validation file:
<field name="siteKey">
<field-validator type="requiredstring">
<message>Field is required</message>
</field-validator>
</field>
--
View this message in context: http://www.nabble.com/Validation-of-Ajax-Tags-tf4680440.html#a13373975
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: Validation of Ajax Tags
Posted by chengas123 <be...@gmail.com>.
Yes, I did add the <s:fielderror /> tag. When I submit the form I get a
message from the <s:fielderror /> tag saying the site field is required and
am returned to the same page with all the input fields completely blank.
Shouldn't they contain the input I entered when filling out the form? The
same validation failure occurs regardless of whether I have filled in the
site field or not.
-Ben
Musachy Barroso wrote:
>
> That should work and you will get a validation error, the only problem
> is that it won't show up on the xhtml theme, so you will have to use
> <s:fielderrors />
>
> musachy
>
> On 10/23/07, chengas123 <be...@gmail.com> wrote:
>>
>> Does anyone have any ideas on how the dojo ajax tags can be validated
>> (autocompleter, datetimepicker, etc.)? I was told this was fixed in 2.1,
>> which I am using, but I cannot get it to work. I'd like to make my
>> autocompleter required and have it validate the same as my other fields.
>> Can I validate its key? What I'd really like to do is have the following
>> autocompleter:
>> <sx:autocompleter label="Site" value="%{system.site.name}"
>> forceValidOption="true"
>> cssStyle="width:132px; height:18px; border:1px solid
>> #7B9EBD"
>> name="site" required="true" href="%{siteList}"
>> loadOnTextChange="true" showDownArrow="false"
>> dropdownWidth="300"
>> searchType="substring" />
>>
>> And then have this in my validation file:
>> <field name="siteKey">
>> <field-validator type="requiredstring">
>> <message>Field is required</message>
>> </field-validator>
>> </field>
>>
>
--
View this message in context: http://www.nabble.com/Validation-of-Ajax-Tags-tf4680440.html#a13384688
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: Validation of Ajax Tags
Posted by Musachy Barroso <mu...@gmail.com>.
That should work and you will get a validation error, the only problem
is that it won't show up on the xhtml theme, so you will have to use
<s:fielderrors />
musachy
On 10/23/07, chengas123 <be...@gmail.com> wrote:
>
> Does anyone have any ideas on how the dojo ajax tags can be validated
> (autocompleter, datetimepicker, etc.)? I was told this was fixed in 2.1,
> which I am using, but I cannot get it to work. I'd like to make my
> autocompleter required and have it validate the same as my other fields.
> Can I validate its key? What I'd really like to do is have the following
> autocompleter:
> <sx:autocompleter label="Site" value="%{system.site.name}"
> forceValidOption="true"
> cssStyle="width:132px; height:18px; border:1px solid #7B9EBD"
> name="site" required="true" href="%{siteList}"
> loadOnTextChange="true" showDownArrow="false" dropdownWidth="300"
> searchType="substring" />
>
> And then have this in my validation file:
> <field name="siteKey">
> <field-validator type="requiredstring">
> <message>Field is required</message>
> </field-validator>
> </field>
>
> --
> View this message in context: http://www.nabble.com/Validation-of-Ajax-Tags-tf4680440.html#a13373975
> 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
>
>
--
"Hey you! Would you help me to carry the stone?" Pink Floyd
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org