+ 3

It alert a message"please fill the form"

I am try to store input datas on using Local Storage .And was put "required" on input tags. But it accept empty value and storage in local storage.Then show me a message "please fill this field". Should I need to implement any method not to store data if input field is empty in jQuery.

5th Oct 2020, 10:10 AM
Zaw Zaw Win🇲🇲
Zaw Zaw Win🇲🇲 - avatar
3 Réponses
+ 4
you can easily check that whether the value is empty or not before storing in localStorage, if (value) { localStorage.setItem(....... } It would check that if value exists, then store the value, otherwise don't.
5th Oct 2020, 10:18 AM
maf
maf - avatar
+ 3
maf thanks you 😍
5th Oct 2020, 10:32 AM
Zaw Zaw Win🇲🇲
Zaw Zaw Win🇲🇲 - avatar
5th Oct 2020, 12:54 PM
maf
maf - avatar