Shell shape does not check

Why in this code after clicking the button an error appears: http://jsfiddle.net/FyUgH/

{"error": "The shell form does not check {'html_initial_name': u'initial-js_lib ',' form ':,' html_name ':' js_lib ',' label ': u'Js lib', 'field' :, 'help_text': '', 'name': 'js_lib'} "}

<form action="#" method="POST"> <input type="text" name="name"> <button id="cli">Submit</button> </form> $('#cli').live('click',function(e){ e.preventDefault(); alert('oo') if($('input[type="text"]').val()=='')alert('input is empty') }) }); 
+6
source share
1 answer

Delete extra

 }) 

It should look like

 $('#cli').live('click',function(e){ e.preventDefault(); alert('oo') if($('input[type="text"]').val()=='')alert('input is empty') }); 

+4
source

Source: https://habr.com/ru/post/898588/


All Articles