From 358bef251577df767fc2f00e5b68a4b6c4048c14 Mon Sep 17 00:00:00 2001 From: khalid Date: Wed, 21 Feb 2024 11:58:05 +0600 Subject: [PATCH] keyup evnt changed to input event to handle pasted values --- script.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/script.js b/script.js index b756358..aca9aa5 100644 --- a/script.js +++ b/script.js @@ -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'); @@ -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'){