tags:

views:

92

answers:

0

My code is

            Form form = new FormPanel();
         form.setEncoding(FormPanel.ENCODING_MULTIPART);
         form.setMethod(FormPanel.METHOD_POST);

            submitButton = new Button("Submit");
            form.getElement().setId("form");
         submitButton.getElement().setId("submit");
         nameTextBox.getElement().setClassName("required");
         nameTextBox.setName("name");
         emailTextBox.getElement().setClassName("required email");
         emailTextBox.setName("email");     

            submitButton.addClickListener(new ClickListener() {

  @Override
  public void onClick(Widget sender) {
   form.submit();
  }

 });

     form.addFormHandler(new FormHandler() {
  public void onSubmit(FormSubmitEvent event) {

                         validateForm();
  }

  public void onSubmitComplete(FormSubmitCompleteEvent event) {

  }
 });

            public native void validateForm() /*-{
 $wnd.$("#form").validate({
   success: function(label)
    { // set   as text for IE
     label.attr("class","checked");
     alert(label.attr("class"));

    },
   submitHandler:function(form) {


   }  
 });
}-*/;

in html file i included

< script type="text/javascript" src="js/jquery-1.3.2.js"> < script type="text/javascript" src="js/jquery.validate.js">

but when i submit a form , form does not not validate

please tell me the solution