hungsama / struts2-jquery

Automatically exported from code.google.com/p/struts2-jquery
0 stars 0 forks source link

Control server side ajax validation through javascript. #1055

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
(This is for feature requests and bugs in Struts2 jQuery Plugin - for
getting help, please use the User Group.
http://groups.google.com/group/struts2-jquery )

What steps will reproduce the problem?
1. Set validate=true in submit button
2. Have a js function for onBeforeSubmit say validateClientSide
3. In validateClientSide on some condition set o.orginalEvent.options.submit = 
false;

What is the expected output? What do you see instead?
- If user's js throws error in doing form submit, no need to make ajax call and 
re-check the same in validateFunc() method.
- Just disable the client side ajax validation on demand.
- TO DO so just replace in 
http://code.google.com/p/struts2-jquery/source/browse/trunk/struts2-jquery-plugi
n/src/main/resources/template/js/struts2/jquery.struts2.js

on line on 1221

replaced  if (o.validate) {

with

if (o.validate && orginal.options.submit) 

Which struts2 version?
2.3.15.1

Which struts2-jquery plugin version?
3.6

Please provide any additional information below.
- I strongly believe we must be able to halt this ajax client side validation 
on demand through javascript.

Original issue reported on code.google.com by ghotanka...@gmail.com on 24 Oct 2013 at 7:23

GoogleCodeExporter commented 9 years ago

Original comment by johgep on 10 Apr 2014 at 7:14