Of course now I show you everything because I am very confused…
This is the code of editviewdefs.php:
<?php
$module_name = ‘PTN_Quotazioni’;
$viewdefs [$module_name] =
array (
‘EditView’ =>
array (
‘templateMeta’ =>
array (
‘maxColumns’ => ‘2’,
‘widths’ =>
array (
0 =>
array (
‘label’ => ‘10’,
‘field’ => ‘30’,
),
1 =>
array (
‘label’ => ‘10’,
‘field’ => ‘30’,
),
),
‘includes’ =>
array (
0 =>
array (
‘file’ => ‘/custom/modules/PTN_Quotazioni/JS/Quotazioni.js’,
),
),
‘useTabs’ => false,
‘tabDefs’ =>
array (
‘DEFAULT’ =>
array (
‘newTab’ => false,
‘panelDefault’ => ‘expanded’,
),
),
),
‘panels’ =>
array (
‘default’ =>
array (
0 =>
array (
0 =>
array (
‘name’ => ‘date_entered’,
‘comment’ => ‘Date record created’,
‘label’ => ‘LBL_DATE_ENTERED’,
),
1 =>
array (
‘name’ => ‘yard_c’,
‘label’ => ‘LBL_YARD’,
),
),
1 =>
array (
0 => ‘assigned_user_name’,
1 => ‘’,
),
2 =>
array (
0 =>
array (
‘name’ => ‘n_pezzi_c’,
‘label’ => ‘LBL_N_PEZZI’,
),
1 =>
array (
‘name’ => ‘tempo_ciclo_c’,
‘label’ => ‘LBL_TEMPO_CICLO’,
),
),
3 =>
array (
0 =>
array (
‘name’ => ‘ore_turno_c’,
‘label’ => ‘LBL_ORE_TURNO’,
),
),
),
),
),
);
;
?>
And this is the code of Quotazioni.js:
<html>
<form action="/action_page.php">
<label for="n_pezzi_c">First val:</label>
<input type="text" id="n_pezzi_c" name="abc"><br></br></input>
<label for="tempo_ciclo_c">second val:</label>
<input type="text" id="tempo_ciclo_c" name="def"><br></br></input>
<label for="ore_turno_c">output:</label>
<input type="text" id="ore_turno_c" name="efg"><br></br></input>
</form>
</html>
/*function CalcoloOre() {
var modLabel = Sugar.language.get('PTN_Quotazioni', 'LBL_N_PEZZI');
var modLabel = Sugar.language.get('PTN_Quotazioni', 'LBL_TEMPO_CICLO');
var modLabel = Sugar.language.get('PTN_Quotazioni', 'LBL_ORE_TURNO');
var $modLabel = LBL_N_PEZZI = document.getElementsById('LBL_N_PEZZI').value;
LBL_TEMPO_CICLO = document.getElementById('LBL_TEMPO_CICLO').value;
}*/
$(document).on('change','#f1_input, #f2_input',function(){
$('#ore_turno_c').val($('#n_pezzi_c').val() / $('#tempo_ciclo_c').val());
});
I’m sorry but I’m really confused and I can’t figure out how to do it …
Please help me