我有一个web应用程序,它在文本框中收集一些数据,然后将它们发送到运行flask的python脚本中
我找到了两种提交表格的方法。在
我的按钮设法收集数据并将其发送到python,并从python收回答案,但不验证输入
我的input标记设法验证文本按钮,但清除表单,并且不设法将的数据发送到python脚本进行处理。在
我想做这两个按钮的方面,我想验证,发送数据到python和退休的数据。在
有什么想法如何将输入提交和按钮的功能组合成一个可点击的项目,验证和提交?在
有什么帮助吗{% extends "layout.html" %}
{% block body %}
$(function() {
var submit_form = function(e) {
$.getJSON($SCRIPT_ROOT + '/add_numbers', {
nm_height: $('input[name="nm_height"]').val(),
mn_material: $('input[name="mn_material"]').val(),
lc_height: $('input[name="lc_height"]').val(),
li6_enrichment_fraction: $('input[name="li6_enrichment_fraction"]').val()
}, function(data) {
$('#result').text(data.result);
$('input[name=nm_height]').focus().select();
});
return false;
};
$('#calculate').bind('click', submit_form);
//$("#myform").bind('ajax:complete', submit_form);
$('input[type=text]').bind('keydown', function(e) {
if (e.keyCode == 13) {
submit_form(e);
}
});
$('input[name=a]').focus();
});
Height of neutron multiplier pebble bed mm
Neutron multiplier material Be or Be12Ti
Height of lithium ceramic pebble bed mm
Lithium 6 enrichment %
predict TBR
TBR =?
The TBR is quoted with a 95% confidence interval
{% endblock %}