WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] help about Javascript - Math (4 posts)

  1. taghaboy
    Member
    Posted 3 years ago #

    hello,
    if i'd like to know if a user select the number of days between 1 to 3 days the condition will be like this :numdays<=3
    if(nomdays<=3) { alert("you select a day between 1 to 3");}

    but what about this :
    4 to 6 days is it numdays<=6 ????
    7 to 13 days
    14 to 20 days

    thanks for help

  2. taghaboy
    Member
    Posted 3 years ago #

    Any idea pls.

  3. taghaboy
    Member
    Posted 3 years ago #

    is this possible for 4 to 6 days
    numdays>3 && numdays<6
    so
    if(numdays>3 && numdays<6) { alert("you select a day between 4 to 6");}

    ?

  4. taghaboy
    Member
    Posted 3 years ago #

    Find it
    for 4 to 6 days
    numdays>3&&numdays<=6

    so, for actions :

    if(nomjours<=3)
    	{
    		alert("you select a day between 1 to 3");
    	}
    
    	else if(nomjours>3&&nomjours<=6)
    		{
    			alert("you select a day between 4 to 6");
    		}	
    
    	else if(nomjours>6&&nomjours<=13)
    		{
    			alert("you select a day between 7 to 13");
    		}
    
    	else if(nomjours>13&&nomjours<=20)
    		{
    			alert("you select a day between 14 to 20");
    		}	
    
    else
    	{
    		alert("you select a day more then 20");
    	}

Topic Closed

This topic has been closed to new replies.

About this Topic