EasyUI Forum

General Category => Bug Report => Topic started by: wade.zhu on August 05, 2014, 01:54:07 AM



Title: textbox cannot load data if created by textarea
Post by: wade.zhu on August 05, 2014, 01:54:07 AM
does textbox only support created by <input>?
if markup tag is textarea, form data cannot be loaded into the textbox, is this planed?
Code:
<form id="ff" method="post">
    <table cellpadding="5">
<tr>
    <td>Name:</td>
    <td><input class="easyui-textbox" type="text" name="name" data-options="required:true"></input></td>
</tr>
<tr>
    <td>Message:</td>
    <td><input class="easyui-textbox" name="message" data-options="multiline:true" style="height:60px"></input></td>
</tr>
    </table>
</form>
<script>
function loadLocal(){
    $('#ff').form('load',{
name:'myname',
message:'message'
    });
}
</script>


Title: Re: textbox cannot load data if created by textarea
Post by: hjzhbb7758 on August 05, 2014, 10:29:41 PM
少年,我表示可以load


Title: Re: textbox cannot load data if created by textarea
Post by: wade.zhu on August 06, 2014, 01:39:43 AM
if change property 'message' tag from <input> to <textarea>, form data will not load successfully,
i track the code, found the jq selector is:

var f=$(_4b7).find("input["+p+"Name=\""+name+"\"]");

textarea does not match the selector

Code:
<textarea class="easyui-textbox" name="message" data-options="multiline:true" style="height:60px"></textarea>


Title: Re: textbox cannot load data if created by textarea
Post by: hjzhbb7758 on August 06, 2014, 03:53:52 AM
我表示在 easyui.min 6619 line 。check your code,Please


Title: Re: textbox cannot load data if created by textarea
Post by: hjzhbb7758 on August 06, 2014, 03:56:14 AM
建议你使用这种方式 


<input class="easyui-textbox" data-options="multiline:true" value="This TextBox will allow the user to enter multiple lines of text." style="width:300px;height:100px">


Title: Re: textbox cannot load data if created by textarea
Post by: wade.zhu on August 06, 2014, 05:58:54 PM
line 6619 is setting the value into the hidden control
line 6635 is setting the display text

i have lots of textarea in my project, it works well before v1.4
it will be a hard work to change all the textarea to input
so i changed the source code, and it works.

Code:
var f=$(_4b7).find("input["+p+"Name=\""+name+"\"]");
// ADD bugfix textarea textbox
if (!f.length) f=$(_4b7).find("textarea["+p+"Name=\""+name+"\"]");
// END ADD


Title: Re: textbox cannot load data if created by textarea
Post by: hjzhbb7758 on August 06, 2014, 07:58:34 PM
used 1.4 easyui can be load textbox value.

please use this code

<input class="easyui-textbox" data-options="multiline:true" value="This TextBox will allow the user to enter multiple lines of text." style="width:300px;height:100px">