Opened 12 years ago

Closed 12 years ago

#5663 closed defect (invalid)

Problem validating form data and the form execute attribute does not fire

Reported by: maryann_wayer@… Owned by: Douglas Hays
Priority: high Milestone: 1.1
Component: Dijit Version: 1.0
Keywords: Cc:
Blocked By: Blocking:

Description (last modified by bill)

The following is a very simple form that I created. I am trying to perform client side validation. The validationTextBox works perfectly and tells the user if the input data is invalid. ' I started out with a submit button but my execute function was not called and the data was posted correctly to the server. I changed the submit button to a regular button on set the onClick to call doSomething. the doSomething function is trying to validate the form. I get the following error on the dojo.validate.check method

dojo.validate has no properties
doSomething(form#form1 DojoForm.action)TestStruts21 (line 107)
isCollapsed()dijit.js (line 20)
(no name)(click clientX=0, clientY=0)dojo.js (line 60)
(no name)(click clientX=0, clientY=0)dojo.js (line 66)
toString()dojo.js (line 20)
[Break on this error]'' 

<script type="text/javascript"> 
      function doSomething(thing)
      {
      
         var profile ={required:["hicNum"]};
         var checkResults = dojo.validate.check(dojo.byId('form1'),profile);

         alert('Form Validation Successfull -  '+checkResults.isSuccessful());
      }
  </script> 

<form type="dijit.form.Form" action="DojoForm.action" method="post" id="form1" execute="doSomething(this)">
      
    <label for="hicNum">Hic Num:</label> 
    <input id="hicNum" dojoType="dijit.form.ValidationTextBox" 
    type="text" name="hicNum" maxLength="12" 
    regExp="w{7,12}" invalidMessage="Hic number requires between 7 and 12 alpha-numeric characters"
    required="true"
    missingMessage="required">
	   
	 
  <button dojoType=dijit.form.Button type="button" name="submit" onClick="doSomething(dojo.byId('form1'))" >Testing</button>
	  </form>

Change History (2)

comment:1 Changed 12 years ago by bill

Cc: maryann_wayer@… removed
Component: CoreDijit
Description: modified (diff)
Owner: changed from anonymous to Douglas Hays
Reporter: changed from guest to maryann_wayer@…

Doug, can you handle this?

comment:2 Changed 12 years ago by Douglas Hays

Milestone: 1.21.1
Resolution: invalid
Status: newclosed

Use dojox.validate.check, not dojo.validate.check

Note: See TracTickets for help on using tickets.