Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
3
3f-timesheet
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
dockers
3f-timesheet
Commits
dc9e756b
Commit
dc9e756b
authored
Nov 01, 2022
by
Azhan Hannan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
log pia 90 -> Block huruf dan simbol !@#$%^&*())_+-=[]\{}|;’:”,<>/?
Expectation: hanya bole key nombor decimal shj.
parent
559d7f38
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
91 additions
and
1 deletions
+91
-1
packages/portal/timesheet/resources/views/form/rejected.blade.php
+91
-1
No files found.
packages/portal/timesheet/resources/views/form/rejected.blade.php
View file @
dc9e756b
...
@@ -109,7 +109,7 @@
...
@@ -109,7 +109,7 @@
@endfor
@endfor
@endif
@endif
<td>
<td>
<input type="
text
" onkeypress="
onlynumber
(
event
)
" name="
total
-
{{
$project
[
'td_project'
]}}
" id="
total
-
{{
$project
[
'td_project'
]}}
" style="
padding
-
right
:
4
px
;
padding
-
left
:
4
px
;
" onchange="
limiter
(
this
,
'{{$project['
td_project
']}}'
);
" readonly="" value=
{
{$total}
}
>
<input type="
text
" onkeypress="
onlynumber
(
event
)
" name="
total
-
{{
$project
[
'td_project'
]}}
" id="
total
-
{{
$project
[
'td_project'
]}}
" style="
padding
-
right
:
4
px
;
padding
-
left
:
4
px
;
" onchange="
limiter
(
this
,
'{{$project['
td_project
']}}'
);
" readonly="
readonly
" value=
{
{$total}
}
>
</td>
</td>
</tr>
</tr>
@endforeach
@endforeach
...
@@ -118,3 +118,92 @@
...
@@ -118,3 +118,92 @@
</form>
</form>
</div>
</div>
@endsection
@endsection
@push('script')
<script>
function onlynumber(evt)
{
var theEvent = evt || window.event;
var key = theEvent.keyCode || theEvent.which;
key = String.fromCharCode(key);
var regex = /[0-9]|\./;
if( !regex.test(key) )
{
theEvent.returnValue = false;
if(theEvent.preventDefault) theEvent.preventDefault();
}
}
</script>
<script>
$().ready(function() {
});
function limiter(input,pid) {
var currenttotal = 0;
var all = 0;
if (input.value < 0) input.value = 0;
if (input.value > 24) input.value = 24;
// if( (input.value%1) > 0 && (input.value%1) <= 0.2 ) {
// input.value = Math.floor(input.value);
// }
// if( (input.value%1) > 0.2 && (input.value%1) <= 0.7 ) {
// input.value = Math.floor(input.value) + 0.5;
// }
// if( (input.value%1) > 0.7) {
// input.value = Math.ceil(input.value);
// }
input.value = parseFloat(parseFloat(input.value).toFixed(1));
for(var i = 0; i < 32; i++){
var value = 0;
var hourValue = document.getElementById('hour['+pid+']['+i+']');
if(hourValue){
hourValue = hourValue.value;
value = parseFloat(parseFloat(hourValue).toFixed(1));
// console.log(isNaN(value));
if(isNaN(value)){
value = 0;
}
if(typeof value === 'number'){
currenttotal += value;
}
}
}
// console.log("
currenttotal
-->
" + currenttotal);
document.getElementById('total-'+pid).value = currenttotal;
// var y = 0;
// for(var j = 1; j < key+1; j++){
// var allid = document.getElementById('total-'+j);
// if (document.getElementById('total-'+j)) {
// y = document.getElementById('total-'+j).value;
// value = parseFloat(parseFloat(y).toFixed(1));
// // all += value;
// }
// }
// console.log(all);
// document.getElementById('all').value = all;
// document.getElementById('total-'+pid).value = currenttotal;
}
</script>
@endpush
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment