Hi,
When creating a form with Editor inputs, it makes the webpag to scroll down to the last editor initiated
For example :
It will make reglenotes always visible (the whole box when empty, only the first line when filled)
The after Load event append BEFORE the focus to the last editor
formBudget.loadStruct(formBudgetData, function(){
formBudget.setItemFocus('d_interne');
window.location = "#top";
});
Any clues ?
formBudgetData = [
{type: "hidden", name:"ref", value:'%%%ref%%%'},
{type: "settings", position: "label-left", labelWidth: 150, inputWidth: 390},
{type: "fieldset", name: "informations", label: "Informations", width:600, list:[
{
type: "calendar",
label: "Echéance interne",
value: '%%%d_interne%%%',
name:"d_interne",
dateFormat: "%Y-%m-%d",
labelWidth: 340, inputWidth: 200,
},
{
type: "calendar",
label: "Echéance bon de commande",
value: '%%%d_bdc%%%',
name:"d_bdc",
dateFormat: "%Y-%m-%d",
labelWidth: 340, inputWidth: 200,
},
{
type: "calendar",
label: "Echéance compta",
value: '%%%d_compta%%%',
name:"d_compta",
dateFormat: "%Y-%m-%d",
labelWidth: 340, inputWidth: 200,
},
{
type: "combo",
label: "Statut",
name: "statut",
required: true,
validate:"ValidNumeric",
options:[{value: "%%%id_statut%%%", text: "%%%id_statut_text%%%"}],
inputWidth: 390,
},
{
type: "editor",
label: "Notes",
value: '%%%notes%%%',
name:"notes",
inputHeight: 300,
},
]},
{type: "newcolumn"},
{type: "fieldset", name: "envoifacture", label: "Envoi de la facture", width:600, list:[
{
type: "calendar",
label: "Date",
value: '%%%envoi_d%%%',
name:"envoi_d",
dateFormat: "%Y-%m-%d",
labelWidth: 340, inputWidth: 200,
},
{
type: "editor",
label: "Notes",
value: '%%%envoi_notes%%%',
name:"envoi_notes",
inputHeight: 100,
},
]},
{type: "fieldset", name: "facturerecu", label: "Facture reçue", width:600, list:[
{
type: "calendar",
label: "Date",
value: '%%%recu_d%%%',
name:"recu_d",
dateFormat: "%Y-%m-%d",
labelWidth: 340, inputWidth: 200,
},
{
type: "editor",
label: "Notes",
value: '%%%recu_notes%%%',
name:"recu_notes",
inputHeight: 100,
},
]},
{type: "fieldset", name: "miseenreglement", label: "Mise en réglement", width:600, list:[
{
type: "calendar",
label: "Date",
value: '%%%regle_d%%%',
name:"regle_d",
dateFormat: "%Y-%m-%d",
labelWidth: 340, inputWidth: 200,
},
{
type: "editor",
label: "Notes",
value: '%%%regle_notes%%%',
name:"regle_notes",
inputHeight: 100,
},
]},
];
formBudget = new dhtmlXForm("formBudget");
formBudget.loadStruct(formBudgetData, function(){
formBudget.setItemFocus('d_interne');
window.location = "#top";
});
formBudget.getCombo("statut").load("index_X.pl?liste=xmlInvoiceListe&champ=statut");