我正在使用HTML和Java脚本的新安全评估网页。出于某种原因,代码无法正常工作,无法获得理想的结果。代码应该工作的方式是让用户回答是或否问题,然后将值传递到整个5个HTML页面,直到用户单击提交时的最后一页为止。然后页面将显示回答为yes的问题数量。将单选按钮值从html页面传递给html。
任何帮助将不胜感激。
感谢,
$('.calc').change(function() {
calcscore();
});
$('#submitted').click(function() {
sumInputs();
result();
});
function sumInputs() {
var inputs = $('.calc:checked'),
result = $('#total').val(),
sum = 0;
for (var i = 0; i < inputs.length; i++) {
sum += parseInt(inputs[i].value);
}
$('#total').val(sum);
}
function calcscore() {
var score = 0;
$('.calc:checked').each(function() {
score += parseInt($(this).val(), 10);
});
$('#total').val(score);
}
-------------------------------------------------
(Last java script code)
$('.calc').change(function() {
calcscore();
});
$('#submitted').click(function() {
sumInputs();
result();
});
function sumInputs() {
var inputs = $('.calc:checked'),
result = $('#total').val(),
sum = 0;
for (var i = 0; i < inputs.length; i++) {
sum += parseInt(inputs[i].value);
}
$('#total').val(sum);
}
function result() {
var text;
var score = (($('#total').val())/57) * 100;
var score = score.toFixed(1);
if (score < 60) {
alert (text = "Total score " + score + ": You have failed the Assessment");
}
else {
alert (text = "Total score " + score + ": You have passed the Assessment");
}
$('#demo').text(text);
}
function calcscore() {
var score = 0;
$('.calc:checked').each(function() {
score += parseInt($(this).val(), 10);
});
$('#total').val(score);
}
\t \t
7. Do you have policies and procedures that address allowing authorized and limiting unauthorized physical access to electronic information systems and the facilities in which they are housed? Yes No N/A |
8. Do your policies and procedures specify the methods used to control physical access to your secure areas, such as door locks, access control systems, security officers, or video monitoring? Yes No N/A |
---------------------------------------
Last html Page
COMPLIANCE AND AUDIT |
---|
<
54. Do you review and revise your security documents, such as: policies,standards, procedures, and guidelines, on a regular basis?
Yes
No
N/A
55. Do you audit your processes and procedures for compliance with establishedpolicies and standards?
Yes
No
N/A
56. Do you test your disaster plans on a regular basis?Yes
No
N/A