@DeepikaR1661877  - If no alert means value not coming proper. Since this on change client script on subcategory so you can get its backend value by using newvalue easily.

Try to put alert as below and see when you change subcategory what is coming up and then use same value to compare in your if loop.

alert("Category"+g_form.getValue('category'));
alert("SubCategory"+g_form.getValue('subcategory'));

 

Below is sample code for client script and it works for me see if this can help you. 

function onChange(control, oldValue, newValue, isLoading, isTemplate) {
   if (isLoading || newValue === '') {
      return;
   }

   //Type appropriate comment here, and begin script below
alert("Category"+g_form.getValue('category'));
alert("SubCategory"+g_form.getValue('subcategory'));
   var subcategory = newValue;
   var category = g_form.getValue('category');
   if(subcategory == 'email' && category == 'inquiry'){
	g_form.addInfoMessage("This is infomessage");
   }else{
	g_form.clearMessages();
   }
   
}

 

If my response has helped you hit helpful button and if your concern is solved do mark my response as correct.

 

Thanks & Regards
Viraj Hudlikar.