What's new
HTML Forums | An HTML and CSS Coding Community

Welcome to HTMLForums; home of web development discussion! Please sign in or register your free account to get involved. Once registered you will be able to connect with other members, send and receive private messages, reply to topics and create your very own. Our registration process is hassle-free and takes no time at all!

using the reply from a if statement to display a result

karneet

Junior Member
Hello everyone, I am new to HTML and just wanted to help my girl friend build her website. She wants to make it such that the user needs to answer a set of questions that has a condition and depending on each reply the result provided would be a alert box stating the data. for example she wants to check the age and marital status. if the age is less than 25 and marital status is single : one option should be displayed similarly if the age is less than 25 but the marital status is divorced another alert box should poop up. Can anyone please please help me with the base code in which i can check for the condition and call a function that does this. I can amend the code according to her need but i am struggling to determine the code. if i can help i want something like this:
function start(age(), abc())
{
abc();
age();
}

if(age<25 && abc=yes)
{
alert("you can apply");
}
else if( age>25 && abc =yes)
{
alert("you can apply");
}
else if(age<25 && abc=no)
{
alert("no");
}
else
{
alert("no");
}
 
Since the only real test is for abc, it would be easier to do this:
Code:
if ( abc == 'yes' ) {
alert("you can apply"); 
}
else
{
alert("no");
}
 
Back
Top