Hi, I'm a beginner to Javascript and still learning.. Pls share the correct step how to show result output of Question1+Question2 using Javascript?
For example if user clicked "2" on Question1 and "3" on Question2, popup windows will show the result 5.
TESTING QUESTIONAIRE
function calc1(a,b)
{
var a=document.frm.no1.value;
var b=document.frm.no2.value;
var total=a+b;
alert(total);
alert("Hello world!");
}
QUESTION1 : | 1 | 2 |
QUESTION2 : | 2 | 3 |
Comments
I think the problem is where you grab data from the form:
I don't know what you used in your form for no1, and no2: checkboxes/radio buttons/text.
Check these tutorial links: radio buttons , checkboxes ,
checkboxes and radio buttons , accessing form elements , accessing forms , simple form validation
You can understand there how you grab data from the form, depending on which type of input you have.