最新の Zendesk 製品を使用しています。いくつかの JavaScript ウィジェットをテストするために、古いスタイルの Zendesk に移動するサンドボックスを使用しました。次のウィジェットをまとめましたが、うまくいきました。
$j(document).ready(function() {
//Grabs the value from Time to Complete.
var dec = $j('#ticket_fields_22215232').val();
//hm is an array where hm[0] is hours and hm[1] is mins.
var hm = new Array();
var hm =
[
(dec > 0) ? Math.floor(dec) : Math.ceil(dec),
dec % 1
];
//Stop user from being able to focus on field.
$j('#ticket_fields_22251826').prop("disabled", true);
//Converting the time to decimal.
dec = hm[0]+Math.round(hm[1]*Math.pow(10,2))/60;
//Places the new value into the hidden field.
jQuery('#ticket_fields_22251826').val(dec);
})
基本的に、あるフィールドから値を取得し、それを操作して、別のフィールドに配置します。この 2 番目のフィールドは編集できません。
実際の Zendesk では何も動作しません。違いは何ですか?