1st Dec 2017, 3:24 AM
Mike
Mike - avatar
4 Answers
+ 11
Here are some errors in your code. HTML: Line 7 : You can't use PHP in SoloLearn HTML+CSS+JS. Line 7 : "method" is wrongly spelled. JS: Line 5 : "=" is wrong. "==" is correct.
1st Dec 2017, 4:10 AM
Krishna Teja Yeluripati
Krishna Teja Yeluripati - avatar
+ 7
try changing your js code to this ~_~ function validate() { var name=""; name=document.getElementsByName("txtname")[0].value; if(name=="") { alert("Name Should Contain Some value"); }else if(name.length>9) { alert("Name Should not Exceed 9 Charecters"); }else { alert(name); } }
1st Dec 2017, 4:26 AM
Leon lit
Leon lit - avatar
+ 6
thing about it a single mistake shows a lot of error
10th Dec 2017, 10:13 AM
Vyshnav Vishnu
Vyshnav Vishnu - avatar
0
Try inserting your code in a window.inload function! window.onload=function(){ //get the elements }
1st Dec 2017, 4:08 AM
᠌᠌Code X
᠌᠌Code X - avatar