Click here to Skip to main content
15,867,594 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
See more:
Hi All

Thanks in Advance

The problem the code which i am mentioned working fine in the html file with dependencies
JavaScript
$("#formid").validate({
		rules: {
			cnName : {
			required :true,
			minlength: 3
		}
		},
		messages : {
		cnName: { 
		required: "Please enter a name",
		minlength: "must 3 elements"
		}
		}
		});

But when it comes to the application, here in my appplication we mentioned the javascript in .js file and calling in the jsp like below code:
XML
<script	src="<%=request.getContextPath()%>/js/monitorScript.js" ></script>
<script src="<%=request.getContextPath()%>/jquery/jquery.js" ></script>
<script src="<%=request.getContextPath()%>/jquery/jquery-1.4.2.min.js" ></script>
<script src="<%=request.getContextPath()%>/jquery/jquery.validate.js" ></script>
<a href="java&lt;!-- no --&gt;script:submitSearchForm();" class="buttonLink"> <bean:message key="SSOSniffer.form.submit" xmlns:bean="#unknown" /></a>

When I am calling the same method present in monitorScript.js, when the submit button is clicked there is no error message is showing.

Please help it is very urgent

and one more thing how can i access it in the function like

function xxx()
{

///the validate code here and then

}
Posted
Updated 27-Dec-10 22:20pm
v4
Comments
[no name] 27-Dec-10 10:31am    
Don't ask for urgent help, it is very rude. This is a volunteer site and people will answer you on their time, not yours.

1 solution

You need to move this line to be after the JQuery files.

<script	src="<%=request.getContextPath()%>/js/monitorScript.js" ></script>
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900