+ 1

Required is not working in input and..

Required attribute isn't working in input. Its getting submitted without check. Is there a minlength attribute for inputs? I thought there was but not working in SL. https://code.sololearn.com/WW6N4Glczfqk/?ref=app

4th Aug 2018, 2:37 AM
Akib
Akib - avatar
12 ответов
+ 1
Change div to form tag with onsubmit="check(event)" and button to input type="submit", delete the onclick event there. Make sure the check(evt) event function includes evt.preventDefault();
4th Aug 2018, 2:54 AM
Calviղ
Calviղ - avatar
+ 2
ES6 is supported on most of the our Sololearn users here. The reason why you cant run ES6 on Code Playground is you may use a old phone that not support ES6 on webview.
4th Aug 2018, 3:07 AM
Calviղ
Calviղ - avatar
+ 1
Seems to work for me...
4th Aug 2018, 3:03 AM
Janning⭐
Janning⭐ - avatar
+ 1
preventDefault is to prevent the default action of form submission in which launch your browser to open new page.
4th Aug 2018, 3:04 AM
Calviղ
Calviղ - avatar
+ 1
Thanks Calviղ. Appreciate your help. Updated the webview. Seem I didn't update it in a while. Its working now..yayyy.. Thanks again calvin.
4th Aug 2018, 3:09 AM
Akib
Akib - avatar
0
Calviղ onsubmit solved the problem but can you explain the preventDefault? Also my browser launches every time I submit.. What to do with that?
4th Aug 2018, 2:58 AM
Akib
Akib - avatar
0
And can you guys tell me why ES6 features and syntax isn't supported in playground. Every time I use them I get syntax error.
4th Aug 2018, 3:02 AM
Akib
Akib - avatar
0
Janning⭐ 😢😢😢My phone doesn't seem to work with ES6. Whenever I tried to run newer codes from trending this happened. I thought support for languages didn't depend on devices.
4th Aug 2018, 3:06 AM
Akib
Akib - avatar
0
hallo guys whats a webview
4th Aug 2018, 7:05 AM
Ntokozo Gift
Ntokozo Gift - avatar
4th Aug 2018, 7:13 AM
Janning⭐
Janning⭐ - avatar
0
thanks man
4th Aug 2018, 7:14 AM
Ntokozo Gift
Ntokozo Gift - avatar
0
👍
4th Aug 2018, 7:17 AM
Janning⭐
Janning⭐ - avatar