Fix input lost when error
This commit is contained in:
parent
ebb418fe3a
commit
15c7bbf9d8
@ -49,8 +49,8 @@ if ($action == 'add')
|
|||||||
|
|
||||||
$dateo = dol_mktime(12,0,0,GETPOST('remonth','int'),GETPOST('reday','int'),GETPOST('reyear','int'));
|
$dateo = dol_mktime(12,0,0,GETPOST('remonth','int'),GETPOST('reday','int'),GETPOST('reyear','int'));
|
||||||
$label = GETPOST('label','alpha');
|
$label = GETPOST('label','alpha');
|
||||||
$amount= GETPOST('amount');
|
$amount= GETPOST('amount','alpha');
|
||||||
$amountto= GETPOST('amountto');
|
$amountto= GETPOST('amountto','alpha');
|
||||||
|
|
||||||
if (! $label)
|
if (! $label)
|
||||||
{
|
{
|
||||||
@ -153,6 +153,12 @@ llxHeader();
|
|||||||
print ' <script type="text/javascript">
|
print ' <script type="text/javascript">
|
||||||
$(document).ready(function () {
|
$(document).ready(function () {
|
||||||
$(".selectbankaccount").change(function() {
|
$(".selectbankaccount").change(function() {
|
||||||
|
console.log("We change bank account");
|
||||||
|
init_page();
|
||||||
|
});
|
||||||
|
|
||||||
|
function init_page() {
|
||||||
|
console.log("Set fields according to currency");
|
||||||
var account1 = $("#selectaccount_from").val();
|
var account1 = $("#selectaccount_from").val();
|
||||||
var account2 = $("#selectaccount_to").val();
|
var account2 = $("#selectaccount_to").val();
|
||||||
var currencycode1="";
|
var currencycode1="";
|
||||||
@ -199,7 +205,9 @@ print ' <script type="text/javascript">
|
|||||||
}).fail(function( data ) {
|
}).fail(function( data ) {
|
||||||
console.error("Error: has returned an empty page. Should be an empty json array.");
|
console.error("Error: has returned an empty page. Should be an empty json array.");
|
||||||
});
|
});
|
||||||
});
|
}
|
||||||
|
|
||||||
|
init_page();
|
||||||
});
|
});
|
||||||
</script>';
|
</script>';
|
||||||
|
|
||||||
@ -215,7 +223,7 @@ if($error)
|
|||||||
$account_from = GETPOST('account_from','int');
|
$account_from = GETPOST('account_from','int');
|
||||||
$account_to = GETPOST('account_to','int');
|
$account_to = GETPOST('account_to','int');
|
||||||
$label = GETPOST('label','alpha');
|
$label = GETPOST('label','alpha');
|
||||||
$amount = GETPOST('amount','int');
|
$amount = GETPOST('amount','alpha');
|
||||||
}
|
}
|
||||||
|
|
||||||
print load_fiche_titre($langs->trans("MenuBankInternalTransfer"), '', 'title_bank.png');
|
print load_fiche_titre($langs->trans("MenuBankInternalTransfer"), '', 'title_bank.png');
|
||||||
@ -246,9 +254,9 @@ print "</td>\n";
|
|||||||
print "<td>";
|
print "<td>";
|
||||||
$form->select_date((! empty($dateo)?$dateo:''),'','','','','add');
|
$form->select_date((! empty($dateo)?$dateo:''),'','','','','add');
|
||||||
print "</td>\n";
|
print "</td>\n";
|
||||||
print '<td><input name="label" class="flat quatrevingtpercent" type="text" value="'.$label.'"></td>';
|
print '<td><input name="label" class="flat quatrevingtpercent" type="text" value="'.dol_escape_htmltag($label).'"></td>';
|
||||||
print '<td><input name="amount" class="flat" type="text" size="6" value="'.$amount.'"></td>';
|
print '<td><input name="amount" class="flat" type="text" size="6" value="'.dol_escape_htmltag($amount).'"></td>';
|
||||||
print '<td style="display:none" class="multicurrency"><input name="amountto" class="flat" type="text" size="6" value="'.$amountto.'"></td>';
|
print '<td style="display:none" class="multicurrency"><input name="amountto" class="flat" type="text" size="6" value="'.dol_escape_htmltag($amountto).'"></td>';
|
||||||
|
|
||||||
print "</table>";
|
print "</table>";
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user