是否可以在4.2应用中添加(或减去)文本框?
您是否可以在不刷新页面的情况下制作新的总数?我想添加以下表格文字以显示最后的余额。
TotalAmountNeeded + TotalRequestFDC + BeforeSixThirty + AfterSixThirty + TotalFromOther =余
{{ HTML::row() }}
{{ HTML::col(6,6,6,6) }}
{{ Form::formGroup() }}
{{ Form::label('TotalAmountNeeded', 'Total Amount Needed') }}
{{ Form::text('TotalAmountNeeded', '0', ['class' => 'form-control', 'data-fv-notempty' => 'false']) }}
{{ Form::closeFormGroup() }}
{{ HTML::closeCol() }}
{{ HTML::col(6,6,6,6) }}
{{ Form::formGroup() }}
{{ Form::label('TotalRequestFDC', 'Total Requested from FDC') }}
{{ Form::text('TotalRequestFDC', '0', ['class' => 'form-control', 'data-fv-notempty' => 'false']) }}
{{ Form::closeFormGroup() }}
{{ HTML::closeCol() }}
{{ HTML::row() }}
{{ HTML::col(6,6,6,6) }}
{{ Form::formGroup() }}
{{ Form::label('BeforeSixThirty', 'Amount Before 6/30') }}
{{ Form::text('BeforeSixThirty', '0', ['class' => 'form-control', 'data-fv-notempty' => 'false']) }}
{{ Form::closeFormGroup() }}
{{ HTML::closeCol() }}
{{ HTML::col(6,6,6,6) }}
{{ Form::formGroup() }}
{{ Form::label('AfterSixThirty', 'Amount After 6/30') }}
{{ Form::text('AfterSixThirty', '0', ['class' => 'form-control', 'data-fv-notempty' => 'false']) }}
{{ Form::closeFormGroup() }}
{{ HTML::closeCol() }}
{{ HTML::closeRow() }}
{{ HTML::row() }}
{{ HTML::closeCol() }}
{{ HTML::closeRow() }}
{{ HTML::row() }}
{{ HTML::col(6,6,6,6) }}
{{ Form::formGroup() }}
{{ Form::label('TotalFromOther', 'Total From Other') }}
{{ Form::text('TotalFromOther', '0', ['class' => 'form-control', 'data-fv-notempty' => 'false']) }}
{{ Form::closeFormGroup() }}
{{ HTML::closeCol() }}
{{ HTML::col(6,6,6,6) }}
{{ Form::formGroup() }}
{{ Form::label('Remainder', 'Remainder Balance') }}
{{ Form::text('Remainder', '0', ['class' => 'form-control', 'data-fv-notempty' => 'false']) }}
{{ Form::closeFormGroup() }}
{{ HTML::closeCol() }}
{{ HTML::closeRow() }}
答案 0 :(得分:0)
这必须在客户端/ JavaScript端完成,而不是在服务器/ Laravel端完成。使用像jQuery这样的东西可以解决问题。
答案 1 :(得分:0)
您可以将jQuery与这样的选择器一起使用:
$("[name='TotalAmountNeeded']");
之后用这个元素做你想做的事。例如,您可以设置新文本:
$("[name='TotalAmountNeeded']").val('New text');