Results 1 to 11 of 11
Thread: jquery validation
- 05-20-2012, 11:29 PM #1
Member
- Join Date
- Apr 2012
- Location
- Delhi
- Posts
- 10
- Rep Power
- 0
- 05-21-2012, 06:01 AM #2
Re: jquery validation
Moved from New to Java
dbWhy do they call it rush hour when nothing moves? - Robin Williams
- 05-21-2012, 11:25 AM #3
Moderator
- Join Date
- Apr 2009
- Posts
- 10,455
- Rep Power
- 16
Re: jquery validation
Far too vague.
Without anything to see there is going to be next to no way of saying what the problem is.Please do not ask for code as refusal often offends.
- 05-24-2012, 09:33 AM #4
Member
- Join Date
- Apr 2012
- Location
- Delhi
- Posts
- 10
- Rep Power
- 0
Re: jquery validation
Java Code:<%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <%@taglib uri="/struts-tags" prefix="s"%> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> <title>Insert title here</title> <script src="${pageContext.request.contextPath}/templet_content/js/jquery.js" type="text/javascript"></script> <script src="${pageContext.request.contextPath}/templet_content/js/jquery.validate.js" type="text/javascript"></script> <script type="text/javascript"> $(document).ready(function(){ $('#form').validate({ rules: { n1:"required", n2:"required", }, messages: { n1:"select option", n2:"select option", } }); }); </script> </head> <body> <s:form id="form"> <s:select list="{'A','B','C'}" name="n1" headerKey="-1" headerValue="--Select--"/> <s:select list="{'1','2','3'}" name="n2" headerKey="" headerValue="--Select--"/> <s:submit/> </s:form> </body> </html>
In this code i am using jquery validation in select box of struts2.
As the above, when headerkey="" then validation works.......
but when headerkey="-1" then validation does not work.......
if anybody have a solution, please post in this thread ....
thank you..
- 05-24-2012, 12:06 PM #5
Moderator
- Join Date
- Apr 2009
- Posts
- 10,455
- Rep Power
- 16
Re: jquery validation
What does the validation do when the headerKey is '-1'?
Also show the resulting HTML from the two struts tags.Please do not ask for code as refusal often offends.
- 05-24-2012, 08:50 PM #6
Member
- Join Date
- Apr 2012
- Location
- Delhi
- Posts
- 10
- Rep Power
- 0
- 05-25-2012, 09:47 AM #7
Moderator
- Join Date
- Apr 2009
- Posts
- 10,455
- Rep Power
- 16
Re: jquery validation
No, that's not the HTML, that's a screen shot.
I want the source that appears on the client.Please do not ask for code as refusal often offends.
- 05-25-2012, 04:19 PM #8
Member
- Join Date
- Apr 2012
- Location
- Delhi
- Posts
- 10
- Rep Power
- 0
Re: jquery validation
HTML code show in fourth post....
- 05-25-2012, 09:26 PM #9
Member
- Join Date
- Apr 2012
- Location
- Delhi
- Posts
- 10
- Rep Power
- 0
Re: jquery validation
This is client side html code...Java Code:<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta content="text/html; charset=ISO-8859-1" http-equiv="Content-Type"> <title>Insert title here</title> <script type="text/javascript" src="/_sctech2/templet_content/js/jquery.js"> <script type="text/javascript" src="/_sctech2/templet_content/js/jquery.validate.js"> <script type="text/javascript"> $(document).ready(function(){ $('#form').validate({ rules: { n1:"required", n2:"required", }, messages: { n1:"select option", n2:"select option", } }); }); </script> </head> <body> <form id="form" method="post" action="/_sctech2/test.jsp;jsessionid=088B0B261E34CD91C219DF2C6C8B047B" name="form" novalidate="novalidate"> <table class="wwFormTable"> <tbody> <tr> <td class="tdLabel"></td> <td> <select id="form_n1" class="valid" name="n1"> <option value="-1">--Select--</option> <option value="A">A</option> <option value="B">B</option> <option value="C">C</option> </select> </td> </tr> <tr> <td class="tdLabel"></td> <td> <select id="form_n2" class="error" name="n2"> <option value="">--Select--</option> <option value="1">1</option> <option value="2">2</option> <option value="3">3</option> </select> <label class="error" for="form_n2" generated="true">select option</label> </td> </tr> <tr> <td colspan="2"> <div align="right"> <input id="form_0" type="submit" value="Submit"> </div> </td> </tr> </tbody> </table> </form> </body> </html>
- 05-28-2012, 10:59 AM #10
Moderator
- Join Date
- Apr 2009
- Posts
- 10,455
- Rep Power
- 16
Re: jquery validation
OK.
Why do you think the validator should view "-1" as an invalid selection?
I can understand "" because it has no value, but "-1" does and so I am not sure why you think it should be flagging that?Please do not ask for code as refusal often offends.
- 07-13-2012, 03:18 PM #11
Member
- Join Date
- Apr 2012
- Location
- Delhi
- Posts
- 10
- Rep Power
- 0
Similar Threads
-
Jquery validation in struts with ajax
By ashish1987 in forum StrutsReplies: 6Last Post: 04-21-2012, 10:19 AM -
Jquery pop out script
By fOmey in forum New To JavaReplies: 1Last Post: 12-03-2010, 02:13 AM -
JQuery Menus
By anithajerome in forum JavaServer Pages (JSP) and JSTLReplies: 0Last Post: 12-01-2010, 10:28 AM -
struts2 with jquery
By amma2009 in forum Advanced JavaReplies: 10Last Post: 11-16-2010, 09:07 AM -
jQuery 1.2.1
By JavaBean in forum Java SoftwareReplies: 0Last Post: 10-25-2007, 04:21 PM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks