EasyUI Forum
September 13, 2025, 02:23:43 PM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: in javascript ,how to according one input filed value to set an another?  (Read 6512 times)
cdtuql
Newbie
*
Posts: 26


View Profile Email
« on: January 01, 2015, 06:06:44 AM »

in javascript ,how to according one input filed value to set an another?
my question is like this:
 <td>性质</td>
                   <td align="left">
                        <select id="dishes_disheseditform_thetypecombox" class="easyui-combobox" name="thetype" style="width:100px;" data-options="
                        onSelect: function(rec){
                        if (rec.value=='00') {
                          $('#dishes_disheseditform_itemNo').val('me');
                         }else if(rec.value=='01') {
                          alert(rec.text);
                         }
                        }
                        ">
                                <option value="no"></option>
                                <option value="00">商品</option>
                                <option value="01">菜品</option>d
                      </select>
                   </td>
                  
                <td>菜品编号</td>
                <td><input id="dishes_disheseditform_itemNo" name="itemNo" class="easyui-textbox"    /></td>
               </tr>

but I can not set the value of input id="dishes_disheseditform_itemNo",
how can i do?
Logged
jarry
Administrator
Hero Member
*****
Posts: 2298


View Profile Email
« Reply #1 on: January 01, 2015, 08:36:14 AM »

The '#dishes_disheseditform_itemNo' is a textbox component, please call 'setValue' method to change its value.
Code:
$('#dishes_disheseditform_itemNo').textbox('setValue', 'me');
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!