EasyUI Forum

General Category => EasyUI for jQuery => Topic started by: Coder on October 26, 2019, 01:49:34 PM



Title: form with external input
Post by: Coder on October 26, 2019, 01:49:34 PM
HTML:
Code:
<div ...>
 <input id="iNum" form="frm1" class="easyui-numberbox" data-options="required:true">
 <input id="iText" form="frm1" class="easyui-textbox" data-options="required:true">
</div>
<form id="frm1" ....></form>

JS:
Code:
 function doCheck(){
  if( $('#frm1').form('validate') ){
   ....
  }
 }

why form.validate always (and  with empty inputs values, texts ) true ?


Title: Re: form with external input
Post by: stworthy on October 26, 2019, 08:30:42 PM
The form field components have no 'form' property, they must be moved to the <form> element.


Title: Re: form with external input
Post by: Coder on October 27, 2019, 07:09:08 AM
thnx, but

Code:
<form id="frm1" ....>
<div ... class="easyui-layout">
 <div  data-options="region: ... >
   <input id="iNum" form="frm1" class="easyui-numberbox" data-options="required:true">
 </div>
 <div  data-options="region: ... >
   <input id="iText" form="frm1" class="easyui-textbox" data-options="required:true">
 </div>
</div>
</form>

didn't draw normally: inner <div ... class="panel-body" ...> have calculated style width: 0px :(
when "easyui-layout" outside <form> all draws good


Title: Re: form with external input
Post by: stworthy on October 29, 2019, 07:37:26 PM
Please try to set the 'width' and 'height' for the <form> element.
Code:
<form id="frm1" .... style="width:800px;height:400px">
<div ... class="easyui-layout" fit="true">
...