EasyUI Forum
March 29, 2024, 03:16:43 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: the validate method about form  (Read 5102 times)
adg456jljlx
Newbie
*
Posts: 6


View Profile
« on: March 12, 2018, 07:36:43 PM »

When I use the validate method in a pop-up form window, it works.

$('#sub_form').form('validate')

<div id="sub_window" class="easyui-window" title="Add Info"
     style="width: 400px; height: auto;">
    <form id="sub_form" method="post">
    </form>
</div>

 But when I used the validate method in a multi-level pop-up window, it was wrong.





Sub_window was the first pop-up window, and tree_add_window was the second popup window.The form is in the second pop-up window.

the version of easyui is 1.5.1.

For help.
« Last Edit: March 13, 2018, 01:21:03 AM by adg456jljlx » Logged
jarry
Administrator
Hero Member
*****
Posts: 2260


View Profile Email
« Reply #1 on: March 12, 2018, 11:41:09 PM »

How do you declare the 'tree_add_window' and the form. Please show an example or some code snippets to demonstrate your issue.
Logged
adg456jljlx
Newbie
*
Posts: 6


View Profile
« Reply #2 on: March 13, 2018, 01:16:33 AM »

How do you declare the 'tree_add_window' and the form. Please show an example or some code snippets to demonstrate your issue.

some code is below. The attachment contains the complete page code.

Thank you very much!

            //字典类型为字典数据,树形或列表数据窗口
            var sub_win = $('#sub_window').window({
                modal: true,
                closed: true,
                minimizable: false,
                maximizable: false,
                onClose: function () {

                }
            });

            //树形数据新增或编辑窗口
            var tree_add_window = $('#tree_add_window').window({
                modal: true,
                closed: true,
                minimizable: false,
                maximizable: false,
                onClose: function () {
                    $('#tree_add_form').form('clear');
                }
            });

<div id="tree_add_window" class="easyui-window" title="Add Info"
     style="width: 400px; height: auto;">
    <form id="tree_add_form" method="post">
        <table width="100%" cellpadding="0" cellspacing="1">
            <tr height="40">
                <td width="100" align="right">
                    <span id="nodeName"></span>:
                    <input type="hidden" name="nodeId"/>
                    <input type="hidden" name="nodePid"/>
                </td>
                <td colspan="3">
                    <input class="easyui-validatebox" type="text" name="nodeName"
                           data-options="required:true,validType:['length[0,50]']" size="30"/>
                </td>
            </tr>
            <tr height="40">
                <td width="100" align="right">
                    <span id="nodeValue"></span>:
                </td>
                <td colspan="3">
                    <input class="easyui-validatebox" type="text" name="nodeValue"
                           data-options="required:true" size="30"/>
                </td>
            </tr>
            <tr height="40" align="left">
                <td>
                    &nbsp;
                </td>
                <td colspan="3">
                    <a id="tree_submit_btn" href="javascript:void(0)"/>
                </td>
            </tr>
        </table>
    </form>
</div>

Logged
jarry
Administrator
Hero Member
*****
Posts: 2260


View Profile Email
« Reply #3 on: March 13, 2018, 02:31:03 AM »

You used a wrong 'name' attribute value(nodeName). Please change to another value.
Code:
<input class="easyui-validatebox" type="text" name="nodeName1"
       data-options="required:true,validType:['length[0,50]']" size="30"/>
Logged
adg456jljlx
Newbie
*
Posts: 6


View Profile
« Reply #4 on: March 13, 2018, 07:36:09 PM »

You used a wrong 'name' attribute value(nodeName). Please change to another value.
Code:
<input class="easyui-validatebox" type="text" name="nodeName1"
       data-options="required:true,validType:['length[0,50]']" size="30"/>

Thank you very much. It is true that this is the cause of this problem.   Cheesy
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!