473,406 Members | 2,293 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

jQuery validate

I would like to know how to solve VALIDATOR IS UNDEFINED error using jquery.validate.js.

firebug say the error in line 276

function delegate(event) {
274 var validator = $.data(this[0].form,
275 "validator");
276 validator.settings["on" + event.type]
277 && validator.settings["on"
278 + event.type].call(
279 validator, this[0]);

can anyone know how to solve this kind of error

my javascript code is
Expand|Select|Wrap|Line Numbers
  1. jQuery('#cost').editable(function(value, settings) {
  2.                     jQuery('[name=<portlet:namespace />cost]').val(value);
  3.                     return(value);
  4.                         },
  5.                 {
  6.              type    : 'textarea',
  7.              width     : '100px',
  8.              submit  : 'Update',
  9.              cssclass: 'formEdit'
  10.                 });   
May 3 '10 #1
5 3008
acoder
16,027 Expert Mod 8TB
Did you mean this.form[0] instead of this[0].form?
May 4 '10 #2
@acoder
var validator = $.data(this[0].form, "validator");
is code from the jquery.validate.js.
so I think we don't need to modified this code and i think we need to pass suitable variable to that method.
please give some advice if u know about this.
i can't fix this issue still now.
Thanks and Regards,
Yan Paing
May 4 '10 #3
acoder
16,027 Expert Mod 8TB
I see. Post your HTML code.
May 4 '10 #4
My jsp code is



Expand|Select|Wrap|Line Numbers
  1. <script type="text/javascript">
  2.  
  3. jQuery(document).ready(function() {
  4.  
  5.             var currentVisibleDetailBlock = null;
  6.  
  7.         jQuery('.pplDetail').hide();
  8. jQuery('span.linkDetail a').click(function() {
  9. var blockDetail = jQuery(this).parent().siblings(".pplDetail"); 
  10. var visible = blockDetail.css("display") == "block"; 
  11. if (visible) { blockDetail.slideUp('slow'); currentVisibleDetailBlock = null; } 
  12. else { 
  13. if (currentVisibleDetailBlock != null) { currentVisibleDetailBlock.slideUp('slow', function() {
  14. blockDetail.slideDown('slow');}) } 
  15. else { blockDetail.slideDown('slow'); } 
  16. currentVisibleDetailBlock = blockDetail; } });
  17.  
  18.  
  19.              jQuery('#description').editable(function(value, settings) {
  20.                     jQuery('[name=<portlet:namespace />description]').val(value);
  21.                     return(value);
  22.                         },
  23.                 {
  24.              type    : 'textarea',
  25.              height  : '80px',
  26.              width     : '200px',
  27.              submit  : 'Update',
  28.              cssclass: 'formEdit'
  29.                 });
  30.  
  31.  
  32.              jQuery('#type').editable(function(value, settings) {
  33.                     jQuery('[name=<portlet:namespace />type]').val(value);
  34.                     return(value);
  35.                         },
  36.                 {
  37.              type    : 'select',
  38.              submit  : 'Update',
  39.              cssclass: 'formEdit',
  40.              data   : " {'Individual':'Individual','Corporate':'Corporate','Partners':'Partners','Hybrid':'Hybrid','selected':'<%= (record != null) ? record.getType() : "" %>'}"
  41.                 });
  42.  
  43.              jQuery('#status').editable(function(value, settings) {
  44.                     jQuery('[name=<portlet:namespace />status]').val(value);
  45.                     return(value);
  46.                         },
  47.                 {
  48.              type    : 'select',
  49.              submit  : 'Update',
  50.              cssclass: 'formEdit',
  51.              data   : " {'Enable':'Enable','Disable':'Disable','selected':'<%= (record != null) ? record.getStatus() : "" %>'}"
  52.                 });
  53.  
  54.  
  55.              jQuery('#version').editable(function(value, settings) {
  56.                     jQuery('[name=<portlet:namespace />version]').val(value);
  57.                     return(value);
  58.                         },
  59.                 {
  60.              type    : 'textarea',
  61.              submit  : 'Update',
  62.              width     : '200px',
  63.              cssclass: 'formEdit'
  64.                 });
  65.  
  66.              jQuery('#cost').editable(function(value, settings) {
  67.                     jQuery('[name=<portlet:namespace />cost]').val(value);
  68.                     return(value);
  69.                         },
  70.                 {
  71.              type    : 'textarea',
  72.              width     : '100px',
  73.              submit  : 'Update',
  74.              cssclass: 'formEdit'
  75.                 });   
  76.  
  77.              jQuery('#costCurrency').editable(function(value, settings) {
  78.                     jQuery('[name=<portlet:namespace />costCurrency]').val(value);
  79.                     return(value);
  80.                         },
  81.                 {
  82.              type    : 'select',
  83.              submit  : 'Update',
  84.              cssclass: 'formEdit',
  85.              data   : " {'SGD':'SGD','selected':'<%= (record != null) ? record.getCostCurrency() : "" %>'}"
  86.                 });
  87.  
  88.             jQuery('#costPeriod').editable(function(value, settings) {
  89.                     jQuery('[name=<portlet:namespace />costPeriod]').val(value);
  90.                     return(value);
  91.                         },
  92.                 {
  93.              type    : 'textarea',
  94.              submit  : 'Update',
  95.              width     : '200px',
  96.              cssclass: 'formEdit'
  97.                 });
  98.  
  99.              jQuery('#costPeriodType').editable(function(value, settings) {
  100.                     jQuery('[name=<portlet:namespace />costPeriodType]').val(value);
  101.                     return(value);
  102.                         },
  103.                 {
  104.              type    : 'select',
  105.              submit  : 'Update',
  106.              cssclass: 'formEdit',
  107.              data   : " {'Weekly':'Weekly','Monthly':'Monthly','selected':'<%= (record != null) ? record.getCostPeriodType() : "" %>'}"
  108.                 });    
  109.  
  110.             jQuery('#promotionCode').editable(function(value, settings) {
  111.                     jQuery('[name=<portlet:namespace />promotionCode]').val(value);
  112.                     return(value);
  113.                         },
  114.                 {
  115.              type    : 'textarea',
  116.              submit  : 'Update',
  117.              width     : '200px',
  118.              cssclass: 'formEdit'
  119.                 });
  120.  
  121.              jQuery('#discount').editable(function(value, settings) {
  122.                     jQuery('[name=<portlet:namespace />discount]').val(value);
  123.                     return(value);
  124.                         },
  125.                 {
  126.              type    : 'textarea',
  127.              width     : '100px',
  128.              submit  : 'Update',
  129.              cssclass: 'formEdit'
  130.                 });    
  131.  
  132.  
  133. });     
  134. </script>
  135. ...
  136. ...
  137.  
  138. ...
  139.  
  140. ..
  141.  
  142. ....
  143.  
  144.  
  145.     <tr class="portlet-section-body results-row alt">
  146.             <td><b><label for="cost_label_1">Price</label></b><font color="red">*</font></td>
  147.             <td>
  148.             <div id="costCurrency" style="display:inline"><%= record.getCostCurrency() %></div>
  149.             <input type="hidden" name="<portlet:namespace />costCurrency" value="<%= record.getCostCurrency() %>" maxlength="75" class="required"/>
  150.  
  151.             <div id="cost" style="display:inline"><%= record.getCost() %></div>
  152.             <input type="hidden" name="<portlet:namespace />cost" value="<%= record.getCost() %>"/>
  153.  
  154.             <div id="costPeriodType" style="display:inline"><%= record.getCostPeriodType() %></div>
  155.             <input type="hidden" name="<portlet:namespace />costPeriodType" value="<%= record.getCostPeriodType() %>" class="required"/>
  156.             </td>
  157.         </tr>
May 5 '10 #5
acoder
16,027 Expert Mod 8TB
Just so that we know we're talking about the same thing: are you using this plugin?
May 5 '10 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: mikeh3275 | last post by:
I'm new to developing in jQuery, so I'm probably doing this wrong. I'm loading a form into a modal dialog box and I'm trying to assign a click event to the button in the form, but I can't seem to...
2
by: thj | last post by:
Hi. I've got this form that I'm trying to validate: <form id="periodForm" action="" method="post"> <p> Periode: <input id="startDate" name="startDate" type="text" size="7" value="<%=...
26
by: RobG | last post by:
Do some of the regulars here need to re-think their (sometimes strident) opposition to libraries? Both Microsoft and Nokia have announced support for jQuery. It seems to have gained quite a bit...
53
by: souporpower | last post by:
Hello All I am trying to activate a link using Jquery. Here is my code; <html> <head> <script type="text/javascript" src="../../resources/js/ jquery-1.2.6.js"</script> <script...
3
pradeepjain
by: pradeepjain | last post by:
hii.. i use cope like this <td><a href='/login.php' id="view-user" >Pradeep</a></td> and defauly jquery dialog code <script type="text/javascript"> $(function() {...
0
by: amskape | last post by:
hi Friends, I need to Upload some files in a Listing , by clicking corresponding Upload link, then a popup window will come with Browse option as Shown in attachment File. My actual need is...
1
by: juganta | last post by:
How do I validate dropdown list in jquery
4
oranoos3000
by: oranoos3000 | last post by:
hi can i change id attribute an element with below command in jquery $("#error").attr("id", "warning"); i know this code is not reasonable but i want to know change id's element after...
1
by: omar999 | last post by:
hi guys i really dont understand where i am going wrong.I've read countless articles including http://blog.nemikor.com/2009/10/03/using-multiple-versions-of-jquery/ but still having trouble with...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.