Quantcast
Channel: Microsoft Dynamics CRM Forum - Recent Threads
Viewing all articles
Browse latest Browse all 79901

how to set the Age Range according to the Age value entered by the user JavaScript

$
0
0

I'm using following function to set the age range but it's giving me an error..

//get the value of integer age//
//set the value of age range//
//if age is between 18 & 25 then choose option 1//
//if age is between 26 & 35 then choose option 2//
//if age is between 36 & 55 then choose option 3//
//if age is between 56 & 65 then choose option 4//


function SetAgeRange()
{
var Age= Xrm.Page.getAttribute("new_age").getValue ();
if (Age>=18 && Age<=25)
{
Xrm.Page.getAttribute("new_age").setValue("100,000,000");
}
else if ( Age>=26 && Age<= 35)
{
Xrm.Page.getAttribute("new_age").setValue("100,000,001");
}
else if (Age>=36 && Age<=55)
{
Xrm.Page.getAttribute("new_age").setValue("100,000,002");
}

else if (Age>=56 && Age<= 65)
{
Xrm.Page.getAttribute("new_age").setValue("100,000,003");
}

var AgeRange=Xrm.Page.getAttribute("new_age").setValue();
}


Viewing all articles
Browse latest Browse all 79901

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>