Jquery validate plugin with ui.dialog
Hi,
In asp.net3.5 environment, if I show a dialog with the div containing the fields to validate, validation option are cleared and validator return always true.
A little sample:
- <html xmlns="http://www.w3.org/1999/xhtml">
- <head runat="server">
- <title></title>
- <link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/base/jquery-ui.css" rel="stylesheet" type="text/css"/>
- <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js"></script>
- <script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js"></script>
- <script type="text/javascript" src="http://dev.jquery.com/view/trunk/plugins/validate/jquery.validate.js"></script>
- <script type="text/javascript">
- $(document).ready(function () {$("#divpop").dialog({ modal: true });});
- $("#form1").validate();
- </script>
- </head>
- <body>
- <form id="form1" runat="server">
- <div>
- <div id="divpop">
- <label>ciao</label><input type="text" id="txttest" name="txttest" class="required"/><br />
- <input type="button" value="validate" onclick="alert($('#form1').valid()); return false;" />
- </div>
- </div>
- </form>
- </body>
- </html>