Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search within Portals and Portlets
Search Coderanch
Advance search
Google search
Register / Login
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
Tim Cooke
paul wheaton
Jeanne Boyarsky
Ron McLeod
Sheriffs:
Paul Clapham
Liutauras Vilda
Devaka Cooray
Saloon Keepers:
Tim Holloway
Roland Mueller
Bartenders:
Forum:
Portals and Portlets
liferay using ajax jquery json
sudheer kumar akurathi
Greenhorn
Posts: 1
posted 11 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
this is my
jsp
in this jsp i need to diplay course name from the database matched with records if he or she enter course name. using ajax+json+jquery with validation can any one explain me?
<form action="<%=editCourseURL%>" method="post" id="register-form" > <div class="label1">Course Name</div> <input type="text" id="cname" name="cname" value=" "/><br /> <div class="label2">Course Description</div> <input type="text" id="cdesc" name="cdesc" value=""/><br/> <div class="label3">Start Date</div> <input type="date" name="sdate" id="sdate" value=""/><br/> <div class="label4">End Date</div> <input type="date" id="edate" name="edate" value="" /><br /> <input type="submit" name="submit" value="Submit" /> </form> <portlet:renderURL var="homeURL"> <portlet:param name="jspPage" value="/html/course/view.jsp"></portlet:param> </portlet:renderURL> <script src="//code.jquery.com/jquery-1.9.1.js"></script> <script src="//ajax.aspnetcdn.com/ajax/jquery.validate/1.9/jquery.validate.min.js"></script> <script type="text/javascript"> $(function() { // Setup form validation on the #register-form element $("#register-form").validate({ // Specify the validation rules rules: { cname: "required", cdesc: "required", sdate: "required", edate: "required" }, // Specify the validation error messages messages: { cname: "Please enter course name", cdesc: "Please enter course description", sdate: "please enter start date", edate: "Please enter end date" }, submitHandler: function(form) { form.submit(); } }); }); </script>
Sam Jimzz
Greenhorn
Posts: 28
I like...
posted 11 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
you can set your values from the db using the methods(i use manual method) described
HERE
.
use ajax for getting the json
string
from the controller to the js file and separate it .,using jQuery display it in jsp.
God Loves You and will never love you less.
Space pants. Tiny ad:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
reply
Bookmark Topic
Watch Topic
New Topic
Boost this thread!
Similar Threads
2 functions at onsubmit
how to get input from javascript and pass to servlet
jQuery form validation not working
validate date in javascript not working
how to transfer data from javascript to jsp
More...