tags:

views:

434

answers:

0

Lets create a great example here

I have a short survery in a dijit.Dialog which I an email hanadler on the server using the code below. What I have not been able ot find is a good example vaildating the form and then doing an ajax submit (using ojo.io.FormBind) and then either sowing an Thank you and then closing the Dialog or showing an error.

Does abody know of a good examples of can provide one.

 <div dojoType="dijit.Dialog" id="dialog1" title="This website is going to close" execute="FormSubmit(arguments[0]);" style="background:#FFFFFF; border:#FF0000 solid 2px;">
  <table>
  <tr><td colspan="2">
  Please complete this short suvey <br />So we to know what you use / need so we can move/save it etc. 
  </td></tr>
   <tr>
   <td><label for="name">Your name: </label></td>
     <td><input dojoType="dijit.form.TextBox" type="text" name="name"  style="width:300px; "></td>
   </tr>
   <tr>
     <td><label for="email">Your Email: </label></td>
     <td><input dojoType="dijit.form.TextBox" type="text" name="email"  style="width:300px; "></td>
   </tr>
   <tr>
     <td><label for="needed">What do you use / need: </label></td>
     <td>
      <textarea dojoType="dijit.form.Textarea" style="width:290px; " name="needed">    
      </textarea>
     </td>
   </tr>   
    <tr>
     <td colspan="2" align="center">
       <button dojoType=dijit.form.Button type="submit">OK</button></td>
   </tr>
  </table>
 </div>

And here is the start of the JS

dojo.require("dojo.parser");
dojo.require("dijit.form.Button");
dojo.require("dijit.Dialog");
dojo.require("dijit.form.TextBox");
dojo.require("dijit.form.Textarea");

dijit.byId('dialog1').show()


function FormSubmit(dialogFields) {

}