• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Tim Cooke
  • Devaka Cooray
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
Bartenders:
  • Carey Brown
  • Roland Mueller

client side validation

 
Ranch Hand
Posts: 225
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi
i am doing client side validations i have made all necessary changes in my project in jsp i have included

In my validation.xml i have defined all validation
validator.xml is also updated

Message Resources all 3 files

my action class & form class are also changed but still on running my form
it shows me following error

No form found under 'userLoginForm' in locale 'en_US'. A form must be defined in the Commons Validator configuration when dynamicJavascript="true" is set.

Please help

thanks in advance
 
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Aditi agarwal wrote:hi
i am doing client side validations i have made all necessary changes in my project in jsp i have included

In my validation.xml i have defined all validation
validator.xml is also updated

Message Resources all 3 files

my action class & form class are also changed but still on running my form
it shows me following error

No form found under 'userLoginForm' in locale 'en_US'. A form must be defined in the Commons Validator configuration when dynamicJavascript="true" is set.

Please help

thanks in advance



Hi Aditi

just change here
onsubmit="validateUserLoginForm(this);
 
Aditi agarwal
Ranch Hand
Posts: 225
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
thanks Shiva for your reply

but i have read in all tutorials that it need to be same as that of formbean type

still as you said i have changed it but of no effect

thanks
 
shiva ram kumar
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Aditi agarwal wrote:thanks Shiva for your reply

but i have read in all tutorials that it need to be same as that of formbean type

still as you said i have changed it but of no effect

thanks



Hey ...
make sure that form class is extends validatorForm and in validation.xml check the formname <form name="xxxx"> should be same in struts-config.xml
and <html:javascript formName="xxxx" />

<html:form action="/ yyyy.do " onsubmit="validatexxxx(this);">
 
Aditi agarwal
Ranch Hand
Posts: 225
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
thanks again shiva ut it is still not working

if you say then i will put my all validation related files over here

thank you
 
shiva ram kumar
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Aditi agarwal wrote:thanks again shiva ut it is still not working

if you say then i will put my all validation related files over here

thank you




yes you can post your struts-config.xml,validation.xml,form class and jsp
 
Aditi agarwal
Ranch Hand
Posts: 225
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
userLogin.jsp


struts-onfig.xml



validations.xml




validator-rules.xml



userLoginForm.java


thank you
waiting for your reply
 
shiva ram kumar
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi aditi.

move <html:javascript formName="userLoginForm"> tag in <head>

and change this <html:form action="/userLogin" onsubmit="validateUserLoginForm(this); ">
to <html:form action="/userLogin" onsubmit="validateuserLoginForm(this); ">

its working ...
 
Aditi agarwal
Ranch Hand
Posts: 225
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hey thanks shiva for your prompt reply

now atleast error is not coming my page is running but the validations are not working now

please give some more suggestions

thanks once again
 
shiva ram kumar
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Aditi agarwal wrote:hey thanks shiva for your prompt reply

now atleast error is not coming my page is running but the validations are not working now

please give some more suggestions

thanks once again



hi aditi.....
it has to work..
check this onces
<html:form action="/userLogin" onsubmit="return validateuserLoginForm(this);">

after changing the above line .run the jsp and check the generated source code in the browser of the userLogin.
you can find the generated javascript.
if it is coming means javascript is working..
 
Aditi agarwal
Ranch Hand
Posts: 225
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi shiva its not working actually i have entered a data in my db that


username : jointsecm
passwd : js@341

here@ is not allowed but its excepting it is not showing any validation

thanks

looking forward for your reply
 
Aditi agarwal
Ranch Hand
Posts: 225
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi shiva its not working actually i have entered a data in my db that


username : jointsecm
passwd : js@341

here@ is not allowed but its excepting it is not showing any validation

thanks

looking forward for your reply
 
Aditi agarwal
Ranch Hand
Posts: 225
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
atleast at my home when i give

<html:javascript formName="userLoginForm"/>

is not giving any error & not validating at all but at my office it gives me same error

help me anyone
 
Aditi agarwal
Ranch Hand
Posts: 225
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
please give me any solution
 
shiva ram kumar
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Aditi agarwal wrote:please give me any solution




Hi aditi

did you kept this inside <head> tag

<html:form action="/userLogin" onsubmit="return validateuserLoginForm(this);">

</head>

onces it is done . run the jsp in the browser. ie or mozilla.

after that check viewsource of your jsp .
you can find the generated javascript ..
 
Aditi agarwal
Ranch Hand
Posts: 225
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi shiva
thanks once again

are you sure i have to put <html:form> in tag as it is giving me warning

instead i have put<htm:javascript> complete tag in the <head> but of no use


ok tell me one thing is it working fine with you hve you checked that

if yes then please paste the code which is working correctly

& also do i need to add any library file for this in my project

guide me for that too

thank you
 
BWA HA HA HA HA HA HA! Tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic