Skip to content

Commit

Permalink
keyup evnt changed to input event to handle pasted values
Browse files Browse the repository at this point in the history
  • Loading branch information
khalid586 committed Feb 21, 2024
1 parent 1088212 commit 358bef2
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions script.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,12 @@ function check(){
}
}

document.getElementById('passenger_name').addEventListener('keyup',(event)=>{
document.getElementById('passenger_name').addEventListener('input',(event)=>{
name = event.target.value;
check();
document.getElementById('name_text').innerText = name;
})
document.getElementById('passenger_phone').addEventListener('keyup',(event)=>{
document.getElementById('passenger_phone').addEventListener('input',(event)=>{
phone = event.target.value;

const digit = document.getElementById('valid_number');
Expand Down Expand Up @@ -158,7 +158,7 @@ allSeats.forEach(seats =>
})
)

document.getElementById('inputfield').addEventListener('keyup',(event) =>{
document.getElementById('inputfield').addEventListener('input',(event) =>{
coupon = event.target.value;

if(coupon == 'NEW15'){
Expand Down

0 comments on commit 358bef2

Please sign in to comment.