当我运行这个 JSFiddle 时,我收到了这个冗长的错误:http: //jsfiddle.net/YqENs/
{"error": "Shell form does not validate{'html_initial_name': u'initial-js_lib', 'form': <mooshell.forms.ShellForm object at 0xa965bac>, 'html_name': 'js_lib', 'html_initial_id': u'initial-id_js_lib', 'label': u'Js lib', 'field': <django.forms.models.ModelChoiceField object at 0xaaeb76c>, 'help_text': '', 'name': 'js_lib'}{'html_initial_name': u'initial-js_wrap', 'form': <mooshell.forms.ShellForm object at 0xa965bac>, 'html_name': 'js_wrap', 'html_initial_id': u'initial-id_js_wrap', 'label': u'Js wrap', 'field': <django.forms.fields.TypedChoiceField object at 0xa9f82cc>, 'help_text': '', 'name': 'js_wrap'}"}
这是代码(w / html):
<!DOCTYPE html>
<html>
<head>
<script>
function greeting()
{
document.getElementById("p1").innerHTML=document.forms["frm1"]["fname"].value;
}
</script>
</head>
<body>
What is your name?<br>
<form name="frm1" onsubmit="greeting()" method="post">
<input type="text" name="fname">
<input type="submit" value="Submit">
</form>
<p id="p1"></p>
</body>
</html>