EasyUI Forum
April 24, 2024, 12:11:50 PM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
  Home Help Search Login Register  
  Show Posts
Pages: [1]
1  General Category / EasyUI for jQuery / Re: populate textbox field from combobox on selecting a combobox value on: August 13, 2017, 04:31:39 AM
Your combobox component must load data with 'id' and 'employee_id' properties set in each items since you set them in your component. So your php script must return the corresponding 'id' and 'employee_id' fields. Open your browser's debug tool to see if the data returned from server is correct.

If you define 'employee_name' as a textbox component, you can't call 'reload' method because the 'reload' method does not exist in the 'textbox' component. To set the value, please call 'setValue' or 'setText' methods instead.


please can you give an example of what you mean. thanks
2  General Category / EasyUI for jQuery / Re: populate textbox field from combobox on selecting a combobox value on: July 28, 2017, 04:29:55 AM
Your component should be declared as a 'textbox' component, please set the class with 'easyui-textbox' instead of 'easyui-validatebox'.
Code:
<input type="text" name="employee_name" id="employee_name" class="easyui-textbox" style=""  />

it is not working please can you show me a working example.
My php code
Code:
    include("../db/dbinclude.php");
$id = intval($_REQUEST['id']);

$rs = $mysqli->query("select email,employee_id from employee where id='$id'") or trigger_error($mysqli->error);
$result = array();
while($row = mysqli_fetch_object($rs)){
array_push($result, $row);
}
echo json_encode($result);
3  General Category / EasyUI for jQuery / populate textbox field from combobox on selecting a combobox value on: July 24, 2017, 09:55:52 AM
i don't know if it is possible i have browsed the internet for a solution to this issue. what i want to do is that when a combobox is selected some textbox will be auto filled based on the return value from the database.

here is typical example of what i intend to do
Code:
    
                            <tr>
                            <td><label>Employee ID:</label></td><td><input type="text" name="employee_id" id="employee_id" class="easyui-combobox" required="required" style="" data-options="
                                valueField: 'id',
                                textField: 'employee_id',
                                url: '../get_ids/getEmployee_id.php',
                                onSelect: function(rec){
                                    $('#employee_name').textbox('clear');
                                    var url2 = '../get_ids/getEmployeeid.php?id='+rec.id;
                                        $('#employee_name').textbox('reload', url2);
                                  }
                               " /></td>
                            </tr>
                           
                            <tr>
                            <td><label>Employee Name:</label></td><td><input type="text" name="employee_name" id="employee_name" class="easyui-validatebox" style=""  /></td>
                            </tr>
i am stuck, can't continue,
please i need help here.
thanks
Pages: [1]
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!