Objective:
| English |
|---|
| To populate a value in a popup form opened by Form Grid, with an existing value in the parent form |
| Thai |
|---|
เมื่อต้องการเติมค่าในฟอร์มป๊อปอัพที่เปิดโดย Form Grid โดยมีค่าที่มีอยู่ในฟอร์มหลัก |
Code:
Type the following code in the popup form:
| Thai |
|---|
พิมพ์รหัสต่อไปนี้ในแบบฟอร์มป๊อปอัพ: |
| Code Block |
|---|
<script type="text/javascript">
$(document).ready(function(){
var mainFormField = "courseName";
var fieldId = "course";
//get value from parent form
var value = $('[name='+mainFormField+']:enabled', window.parent.document).val();
//store the value to a field
$('[name='+fieldId+']:enabled').val(value);
});
</script> |